From b15344de493c57ac248374b1f360b2c5ce0d66e3 Mon Sep 17 00:00:00 2001 From: XuefengWu Date: Mon, 22 Sep 2014 20:10:34 +0800 Subject: [PATCH 1/3] add tip for the important jsx convention I missed the convention and wast hours to figure out what's wrong. Add this tip in the document for who would miss the importance comment. --- docs/getting-started.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/getting-started.md b/docs/getting-started.md index 36c3a59b..049ece11 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -57,6 +57,8 @@ React.renderComponent( document.getElementById('example') ); ``` +> ```/** @jsx React.DOM */``` is must, or jsx would not convert. + Then reference it from `helloworld.html`: ```html{10} From 0695f4158e14a779f2156fdf1bd76f1ad8235010 Mon Sep 17 00:00:00 2001 From: XuefengWu Date: Tue, 23 Sep 2014 15:22:11 +0800 Subject: [PATCH 2/3] Update getting-started.md merge the warn and explain for the @jsx --- docs/getting-started.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 049ece11..b6574b5a 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -57,7 +57,11 @@ React.renderComponent( document.getElementById('example') ); ``` -> ```/** @jsx React.DOM */``` is must, or jsx would not convert. + +> Note: +> +> ```/** @jsx React.DOM */``` is *must*, which is jsx convention. The comment parser is very strict right now; in order for it to pick up the `@jsx` modifier, two conditions are required. The `@jsx` comment block must be the first comment on the file. The comment must start with `/**` (`/*` and `//` will not work). If the parser can't find the `@jsx` comment, it will output the file without transforming it. + Then reference it from `helloworld.html`: @@ -90,9 +94,6 @@ React.renderComponent( ); ``` -> Note: -> -> The comment parser is very strict right now; in order for it to pick up the `@jsx` modifier, two conditions are required. The `@jsx` comment block must be the first comment on the file. The comment must start with `/**` (`/*` and `//` will not work). If the parser can't find the `@jsx` comment, it will output the file without transforming it. Update your HTML file as below: From 686961b23d6a425de466dd1bc5746148f842fc17 Mon Sep 17 00:00:00 2001 From: XuefengWu Date: Wed, 24 Sep 2014 08:26:10 +0800 Subject: [PATCH 3/3] Update getting-started.md fix grammar --- docs/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index b6574b5a..01a4c301 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -60,7 +60,7 @@ React.renderComponent( > Note: > -> ```/** @jsx React.DOM */``` is *must*, which is jsx convention. The comment parser is very strict right now; in order for it to pick up the `@jsx` modifier, two conditions are required. The `@jsx` comment block must be the first comment on the file. The comment must start with `/**` (`/*` and `//` will not work). If the parser can't find the `@jsx` comment, it will output the file without transforming it. +> ```/** @jsx React.DOM */``` is *required*. The comment parser is very strict right now; in order for it to pick up the `@jsx` modifier, two conditions are required. The `@jsx` comment block must be the first comment on the file. The comment must start with `/**` (`/*` and `//` will not work). If the parser can't find the `@jsx` comment, it will output the file without transforming it. Then reference it from `helloworld.html`: