Shared React state across target components #1675
yblok13
started this conversation in
General feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What's the best way to share state between targets?
My use case requires two targets with the same component. With the way the checkout extensions are structured, these two targets render duplicate components making them both handle the logic (network requests, etc) When trying to handle state/effect between them, they often clash.
I pondered creating another static component that handles the main logic, but am stuck with how to update the state of the other components.
A solution I thought of was:
Beta Was this translation helpful? Give feedback.
All reactions