Introduction of React
You can use Bower to download react
bower install react
Introduced react(.min).js
and JSXTransformer.js
. You can not use JSX in react components, but JSX is recommended. The introduction of the Jsxtransformer.js Library is to implement the code conversion in the browser, it is best to convert the JSX code into normal JS code, and then remove JSXTransformer.js
the reference.
JSX code is written in <script type="text/jsx">
, note type
is text/jsx
.
JSX-JS
npm install -g react-toolsjsx --watch src/ build/
Once the jsx file in SRC has been modified, it is automatically converted to the build folder.
Hello World
One of the simplest react components.
HTML file
<!DOCTYPE html>
Main.js file
var HelloWorld = React.createClass({ render: function () { return
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
"React" hot warm-up: Hello World