-
-
Notifications
You must be signed in to change notification settings - Fork 10
Add section for TSX #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
9f77526
5f041de
58f5601
e7505e6
ac6ab35
0ddb5a6
5545b6e
3be690c
cfb5f34
3fc4e23
dd5a169
07ea4f3
bef2403
d77bb64
18c8d03
1b34947
b26bd4a
be73195
84b6c46
039d85f
3c5e9e8
1f0e45d
db934ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,9 +5,12 @@ Explanation, examples, and build notes on how to use JSX in your Mithril.js-base | |||||
| # JSX | ||||||
|
|
||||||
| - [Description](#description) | ||||||
| - [Setup](#setup) | ||||||
| - [Setup JSX](#setup-jsx) | ||||||
| - [Production build](#production-build) | ||||||
| - [Using Babel with Webpack](#using-babel-with-webpack) | ||||||
| - [Setup TSX](#setup-tsx-jsx-in-typescript) | ||||||
| - [Enabling Fragments](#enable-fragments) | ||||||
| - [Using Closure Components in TSX](#using-closure-components-in-tsx) | ||||||
| - [Differences with React](#differences-with-react) | ||||||
| - [JSX vs hyperscript](#jsx-vs-hyperscript) | ||||||
| - [Tips and Tricks](#tips-and-tricks) | ||||||
|
|
@@ -58,9 +61,9 @@ m.render(document.body, <MyComponent />) | |||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ### Setup | ||||||
| ### Setup JSX | ||||||
|
|
||||||
| The simplest way to use JSX is via a [Babel](https://babeljs.io/) plugin. | ||||||
| When using JavaScript, the simplest way to use JSX is via a [Babel](https://babeljs.io/) plugin. When using using [TypeScript](https://www.typescriptlang.org/) follow the [instructions below](#setup-tsx-jsx-in-typescript) | ||||||
|
||||||
| When using JavaScript, the simplest way to use JSX is via a [Babel](https://babeljs.io/) plugin. When using using [TypeScript](https://www.typescriptlang.org/) follow the [instructions below](#setup-tsx-jsx-in-typescript) | |
| When using JavaScript, the simplest way to use JSX is via a [Babel](https://babeljs.io/) plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I shortened it. But I do think its wise to link to TSX in this secion. A lot of times the term "JSX" is used for "TSX" interchangably (so is "JavaScript" for "TypeScript") and TypeScript users might stumble over this section and follow the wrong instructions. Tell me if you find that unnecessary and I should fully remove it
JodliDev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
JodliDev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
JodliDev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
JodliDev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
JodliDev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
JodliDev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
JodliDev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
JodliDev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
JodliDev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
JodliDev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
JodliDev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you come up with a shorter name for this helper? Maybe something like component could work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that I chose a poor name for that helper function. But I think component would not be a good idea since it already exists in Mithril.js and also does not really make it clear what it does. I changed it to TsClosureComponent which hopefully is a bit more clear. It is not really shorter so I could also change it to TsClosure for example. But I find TsClosureComponent more descriptive.
Let me know what you think
Uh oh!
There was an error while loading. Please reload this page.