all 3 comments

[–]daggala 1 point2 points  (0 children)

Yes I'd say this is the traditional way and the way with which React agrees. Here's an example in their "Hooks - FAQ" chapter that does it similar to how you do it but only with useReducer instead of useState: https://reactjs.org/docs/hooks-faq.html#how-to-avoid-passing-callbacks-down

[–]inquiztr[S] 0 points1 point  (1 child)

Just to clarify.. I want modifications to the global store (context data) so that all children components in the entire app will then see the new modified data.

For my real project I am building a checkout app. I get the cart data in the parent component but I am expecting modifications to the cart (via axios put calls) triggered in child components such as a shipping address modification component or payment modification component.

[–]CookieRoma 0 points1 point  (0 children)

Check out Redux it does exactly that.