amitmerchant1990 / amitmerchant-dot-com-comments

1 stars 0 forks source link

update-state-of-hook-from-other-components-in-react/ #51

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Update state of component from other components using React hooks — Amit Merchant — A blog on PHP, JavaScript, and more

React Hooks are a great way to add stateful logic into function components. So, if you want to maintain a state in the component you can do it using useState hook like so.

https://www.amitmerchant.com/update-state-of-hook-from-other-components-in-react/

jcal589 commented 2 years ago

This was super helpful! Helped me figure out how to handle it in my component. Much appreciated!

MOHAMMED-SENHAJI commented 2 years ago

thanks, that helped me a lot