【发布时间】:2021-01-02 12:55:22
【问题描述】:
您好,我正在尝试将一个组件中的数据呈现给另一个组件,它们是彼此的兄弟。 使用useState Hook(rff)基于组件代码(rcf)
index.js -> is entry point, that calls only one component App, as we have no route
App.js -> is the parent component, which has two child, Certification and Panel
Certification.js -> takes input
Panel -> renders data from certification
我知道我的 handleFromCert 有问题(这是我的句柄更改功能)
这里是我的代码 -rff
https://codesandbox.io/s/zen-paper-gil-xcyj3?file=/src/
这里是基于 rcf 并且可以正常工作的代码
【问题讨论】:
标签: reactjs react-hooks use-state