Hello react
来源:互联网 发布:阿里云客服怎么样 编辑:程序博客网 时间:2024/05/18 03:01
<style> .wm-h{ color:red; } </style> </head> <body> <div id="app"></div> <script type="text/babel"> var Comp=React.createClass({ render:function(){ return <div style={{fontSize:'30px'}} className="wm-h">{this.props.name} <h1>我就试试{this.props.title}</h1></div>; } }); ReactDOM.render( <Comp name="666" title="44944"/>, document.getElementById('app') ); </script>
React.createClass声明组件
ReactDOM.render(component,挂载点)
jsx 中 style={{key:value}}形式 key 用驼峰命名
class为 className=”
React Components Lifecycle
hook :
Mounting
1.getDefaultProps() 2.getInitialState() 3.componentWillMount render 4 componentDidMount
Updating
Unmounting
componentWillUnmount
(个人觉得应该再添加DidUnmount 状态)
阅读全文
0 0
- Hello react
- react--hello,word
- Hello world React
- hello react.js
- Hello,React Native
- Hello SmartWeb and React
- hello React.js
- react入门,Hello World
- react之“hello world”
- React Hello,World
- React 2 hello world
- React Hello world
- React Hello JSX
- React.js hello world
- 【React】热热身:Hello World
- 初探react-native Hello World
- React Native 之 Hello World
- React Native版Hello World
- 遭遇战_模拟
- Vuforia之Virtual Button 教程
- PHP安装新扩展
- 面向切面编程AOP的配置
- 今天做到一道面试题:请介绍一下单例模式
- Hello react
- hightchart导出中文乱码
- Android 沉浸式标题栏的快速实现方式
- 二维数组操作运算
- RPC理解
- 2014年第五届蓝桥杯C/C++程序设计本科B组决赛 年龄巧合(结果填空)
- linux进入mysql数据库
- Struts1框架三之里面的DynActionForm讲解
- python: reduce()函数、lambda函数、map()函数