mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #5387 from MattijsKneppers/master
updated Basic Example with External JSX instructions
This commit is contained in:
committed by
Scott Feeney
parent
79732f04bf
commit
decfbdf1f5
@@ -18,8 +18,16 @@
|
||||
</p>
|
||||
</div>
|
||||
<h4>Example Details</h4>
|
||||
<p>This is written with JSX in a CommonJS module and precompiled to vanilla JS by running:</p>
|
||||
<pre>npm start</pre>
|
||||
<p>This is written with JSX in a CommonJS module and precompiled to vanilla JS by navigating to the example
|
||||
directory
|
||||
<pre>cd /path/to/react/examples/example-name</pre>
|
||||
and running
|
||||
<pre>npm start</pre>
|
||||
<br>
|
||||
(don't forget to install first)
|
||||
<pre>npm install</pre>
|
||||
<br>
|
||||
</p>
|
||||
<p>
|
||||
Learn more about React at
|
||||
<a href="https://facebook.github.io/react" target="_blank">facebook.github.io/react</a>.
|
||||
|
||||
@@ -10,12 +10,17 @@
|
||||
<h1>Basic Example with External JSX</h1>
|
||||
<div id="container">
|
||||
<p>
|
||||
If you can see this, React is not working right. This is probably because you're viewing
|
||||
this on your file system instead of a web server. Try running
|
||||
If you can see this, React is not working right. This is probably because you're viewing
|
||||
this on your file system instead of a web server.<br>
|
||||
Try navigating to the React root
|
||||
<pre>
|
||||
cd /path/to/react
|
||||
</pre>
|
||||
and running
|
||||
<pre>
|
||||
python -m SimpleHTTPServer
|
||||
</pre>
|
||||
and going to <a href="http://localhost:8000/">http://localhost:8000/</a>.
|
||||
and going to <a href="http://localhost:8000/examples/basic-jsx-external/">http://localhost:8000/examples/basic-jsx-external/</a>.
|
||||
</p>
|
||||
</div>
|
||||
<h4>Example Details</h4>
|
||||
|
||||
@@ -17,9 +17,17 @@ babel example.js --out-dir=build</pre>
|
||||
</div>
|
||||
<h4>Example Details</h4>
|
||||
<p>This is written with JSX in a separate file and precompiled to vanilla JS by running:</p>
|
||||
|
||||
<p><i>With Babel lower than 6.0</i></p>
|
||||
<pre>npm install -g babel
|
||||
cd examples/basic-jsx-precompile/
|
||||
babel example.js --out-dir=build</pre>
|
||||
|
||||
<p><i>With Babel 6.0 or higher</i></p>
|
||||
<pre>npm install -g babel-cli
|
||||
npm install babel-preset-react
|
||||
cd examples/basic-jsx-precompile/
|
||||
babel example.js --presets react --out-dir=build</pre>
|
||||
<p>
|
||||
Learn more about React at
|
||||
<a href="https://facebook.github.io/react" target="_blank">facebook.github.io/react</a>.
|
||||
|
||||
Reference in New Issue
Block a user