摘要: React 自定义组件的两种方式: 函数组件和类组件 第一种,函数组件(无状态,即无私有属性,state): function Welcome(props) { return <h1>Hello, {props.name}</h1>; } 第二种,类(ES6)组件(有状态。即有私有属性,state) 阅读全文
posted @ 2020-05-17 15:30 养猪至富 阅读(4182) 评论(0) 推荐(0)