Hi, I believe that this can potentially be an issue, though I'm not sure.
I was wondering about good patterns concerning the react context.
Let's get a public library, for example react-intl that exposes a Provider (IntlProvider).
Let's create a library barLib that uses react-intl to manage translations internally and that also exposes a Provider.
Now let's imagine I create a web app and use both barLib and react-intl.
I don't expect the barLib to ever override my react-intl context, because i'm not aware it uses internally the react-intl lib.
But the barLib can accidentally override the react-intl context => https://codesandbox.io/s/embedded-contexts-test-z8e7b
This kinda breaks the isolation of libs IMO.
I see several solutions :
barLib (pretty extreme)barLib, if so merge the context values ?I'm not convinced with either solutions, what do you guys think about it ?
Support requests filed as GitHub issues often go unanswered. We want you to find the answer you're looking for, so we suggest the following alternatives:
If you have a coding question related to React and React DOM, it might be better suited for Stack Overflow. It's a great place to browse through frequent questions about using React, as well as ask for help with specific questions.
https://stackoverflow.com/questions/tagged/react
There are many online forums which are a great place for discussion about best practices and application architecture as well as the future of React.
Check that there is not already an intl context in the barLib, if so merge the context values ?
Seems like you'd definitely want to merge values in this case, FWIW.
I'll try stackoverflow, thank you for your time :)