摘要: 参考:https://facebook.github.io/react/docs/introducing-jsx.html 一、JSX介绍 二、JSX使用 1.使用大括号嵌入js表达式 2.JSX编译之后是js对象,也就是说,可以赋值给变量,作为参数,或者函数返回值等等 3.使用JSX为属性赋值 4 阅读全文
posted @ 2017-07-10 17:43 sheshihao 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 一、render方法 参考https://itbilu.com/javascript/react/EJiqU81te.html React的组件最终通过render方法渲染到DOM中,该方法由ReactDOM类库提供。API如下: 二、动手写一个Hello World 1.接着上一次打开webpac 阅读全文
posted @ 2017-07-10 17:08 sheshihao 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 一、搭建新工程 参考:https://facebook.github.io/react/docs/installation.html npm install -g create-react-app//npm安装create-react-app create-react-app my-app//使用c 阅读全文
posted @ 2017-07-10 16:21 sheshihao 阅读(219) 评论(0) 推荐(0) 编辑