摘要:
React 路由 React 推出两个版本 一个是 react-router 一个是 react-router-dom 这里使用的是 react-router-dom 因为该方法多了一个 Link 组件 1. 在创建好 React 环境的基础上 下载 react-router-dom npm ins 阅读全文
摘要:
在使用React脚手架之前需要通过 create-react-app 快速构建 React 开发环境 , 注意 : create-react-app 自动创建的项目是基于 Webpack + ES6 。 执行以下命令创建项目: $ npm install -g create-react-app $ 阅读全文
摘要:
React 中双项绑定,文本输入框的值,不能用 this.props.value 读取,而要定义一个 onChange 事件的回调函数,通过 event.target.value 读取用户输入的值。 阅读全文