Skip to content

Commit decfbdf

Browse files
zpaograue
authored andcommitted
Merge pull request facebook#5387 from MattijsKneppers/master
updated Basic Example with External JSX instructions
1 parent 79732f0 commit decfbdf

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

examples/basic-commonjs/index.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,16 @@ <h1>Basic CommonJS Example with Browserify</h1>
1818
</p>
1919
</div>
2020
<h4>Example Details</h4>
21-
<p>This is written with JSX in a CommonJS module and precompiled to vanilla JS by running:</p>
22-
<pre>npm start</pre>
21+
<p>This is written with JSX in a CommonJS module and precompiled to vanilla JS by navigating to the example
22+
directory
23+
<pre>cd /path/to/react/examples/example-name</pre>
24+
and running
25+
<pre>npm start</pre>
26+
<br>
27+
(don't forget to install first)
28+
<pre>npm install</pre>
29+
<br>
30+
</p>
2331
<p>
2432
Learn more about React at
2533
<a href="https://facebook.github.io/react" target="_blank">facebook.github.io/react</a>.

examples/basic-jsx-external/index.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@
1010
<h1>Basic Example with External JSX</h1>
1111
<div id="container">
1212
<p>
13-
If you can see this, React is not working right. This is probably because you&apos;re viewing
14-
this on your file system instead of a web server. Try running
13+
If you can see this, React is not working right. This is probably because you&apos;re viewing
14+
this on your file system instead of a web server.<br>
15+
Try navigating to the React root
16+
<pre>
17+
cd /path/to/react
18+
</pre>
19+
and running
1520
<pre>
1621
python -m SimpleHTTPServer
1722
</pre>
18-
and going to <a href="http://localhost:8000/">http://localhost:8000/</a>.
23+
and going to <a href="http://localhost:8000/examples/basic-jsx-external/">http://localhost:8000/examples/basic-jsx-external/</a>.
1924
</p>
2025
</div>
2126
<h4>Example Details</h4>

examples/basic-jsx-precompile/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,17 @@ <h1>Basic Example with Precompiled JSX</h1>
1717
</div>
1818
<h4>Example Details</h4>
1919
<p>This is written with JSX in a separate file and precompiled to vanilla JS by running:</p>
20+
21+
<p><i>With Babel lower than 6.0</i></p>
2022
<pre>npm install -g babel
2123
cd examples/basic-jsx-precompile/
2224
babel example.js --out-dir=build</pre>
25+
26+
<p><i>With Babel 6.0 or higher</i></p>
27+
<pre>npm install -g babel-cli
28+
npm install babel-preset-react
29+
cd examples/basic-jsx-precompile/
30+
babel example.js --presets react --out-dir=build</pre>
2331
<p>
2432
Learn more about React at
2533
<a href="https://facebook.github.io/react" target="_blank">facebook.github.io/react</a>.

0 commit comments

Comments
 (0)