摘要: 五、React 核心是组件 在 React 中,我们使用组件(有状态、可组合、可重用)来描述 UI 。 在任何编程语言中,你都可以将组件视为简单的函数。 React 组件也一样, 它的输入是 props,输出是关于 UI 的描述。我们可以在多个 UI 中重用单个组件,组件也可以包含其他组件。Reac 阅读全文
posted @ 2022-09-26 11:09 xiaofeng123aa 阅读(81) 评论(0) 推荐(0)
摘要: React调用回调函数,正确设置this指向的三种方法 通过bind this.increment = this.increment.bind(this); 通过箭头函数 <button onClick={this.multi}>点我*10</button> multi = () => { this 阅读全文
posted @ 2022-09-26 10:56 xiaofeng123aa 阅读(78) 评论(0) 推荐(0)