![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react学习笔记
weixin_38522914
这个作者很懒,什么都没留下…
展开
-
react学习笔记----受控组件
1.最简单的受控组件(输入框的值改变,导致onChange事件发生,导致state里面的str被重新赋值,输入框的值受state控制,所以是受控组件) import React, { Component } from 'react' export default class Control extends Component { constructor(props){ super(props); this.state ={ str:''原创 2021-01-21 14:43:55 · 97 阅读 · 0 评论 -
react学习比笔记1---兄弟组件传值
#兄弟组件传值,由one传给two需要安装PubSub 首先定义一个组件One import React, { Component } from 'react' import PubSub from 'pubsub-js' export default class One extends Component { componentDidMount(){ PubSub.subscribe("msg",(evt,data)=>{ //监听接收数据 cons原创 2021-01-21 14:19:39 · 89 阅读 · 0 评论