react 组件积累
2019-03-08 14:48 ZealouSnesS 阅读(292) 评论(0) 编辑 收藏 举报material-ui
material-table
ant-design
https://ant.design/docs/react/getting-started-cn
定义组件(注意,组件的名称首字母必须大写)
类继承:有内部状态state,有生命周期函数
import React, {Component} from 'react'; class HelloMessage extends Component { render() { return <div>Hello world.</div>; } }
函数式组件:简洁,性能高
import React from 'react'; function HelloMessage() { return <div>Hello world.</div>; } // 或者: const HelloMessage = () => <div>Hello world.</div>;