相关疑难解决方法(0)

React Hook : Send data from child to parent component

I'm looking for the easiest solution to pass data from a child component to his parent.

I've heard about using Context, pass trough properties or update props, but I don't know which one is the best solution.

I'm building an admin interface, with a PageComponent that contains a ChildComponent with a table where I can select multiple line. I want to send to my parent PageComponent the number of line I've selected in my ChildComponent.

Something like that :

PageComponent …

reactjs react-hooks

15
推荐指数
3
解决办法
1万
查看次数

标签 统计

react-hooks ×1

reactjs ×1