We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.4.2
static defaultProps = { classPrefix: 'tabs', onChange: () => {}, }; ....... 3. 用 function prop 与父组件通信 现在我们发现对于 state 来说,它的通信集中在组件内部;对于 props 来说,它的通信是父组 件向子组件的传播。相关代码如下: 7 handleTabClick(activeIndex) { // ... this.props.onChange({activeIndex, prevIndex}); } 我们通过点击事件 handleTabClick 触发了 onChange prop 回调函数给父组件必要的值。对于兄 弟组件或不相关组件之间的通信,具体请看 2.4 节。
触发回调函数给父组件传值我明白,但是onChange写个空函数是什么意思?传过去啥也不干?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1.4.2
触发回调函数给父组件传值我明白,但是onChange写个空函数是什么意思?传过去啥也不干?
The text was updated successfully, but these errors were encountered: