需要npm安装依赖工具,npm安装方法 mac安装node js 这篇之前安装的。 安装好nodejs之后,安装工具 npm install --global babel-cli npm install babel-preset-react 之后让babel检查源文件目录,有更改自动编译。 babel --presets react src --watch --out-dir build src/hello.js -> build/hello.js html内容,react.js直接在官网下载的编译好的。

    
        test
        
        

    
    
        
hello.js文件。
ReactDOM.render(
    

Hello, world!

, document.getElementById('example') );
然后目录里起一个httpserver,就能看到hello world了。

上一篇:
下一篇:

相关文章:

Categories: 博客记录

0 Responses so far.

Leave a Reply