-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react项目组件通信 #4
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
一、父-子通信
React 的数据流是单向的,父组件可以直接将 this.props 传入子组件
1、父组件
场景需求:
解决方法:
render(){}函数
回显场景
添加场景
2、子组件
二、子-父通信
子组件在调用该函数时,就可以将想要交给父组件的数据以函数入参的形式给出去
父组件
子组件
3、跨组件通信
The text was updated successfully, but these errors were encountered: