简体   繁体   中英

REACT.JS Passing a State through Components

这是我的情况)

I should update a state in the component 'TimeDisplay' from the component 'TaskItem' (you can see the components hierarchy as it follows. How can I implement it?

You should really look into using Redux for global state management. It's got a bit of a learning curve but it is 100% worth it for this exact usage. The other way is have your state be at the top most component (Panel) and you can pass down whatever state your need to down as props to all the child components.

Redux.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM