This repository has been archived by the owner on Jul 28, 2023. It is now read-only.
Child using React context throws when there is no parent that provides that context #46
Labels
bug
Something isn't working
If you add a child block that is using a React context, but there is no parent block present to provide it, the hydration crashes.
At first, I thought it should be a matter of just checking if the provider is there and avoiding the error, but it's true that
useContext
needs to return something. So I'm not sure anymore what should happen here:null
touseContext
, although that may lead to errors in React that may be hard to debug.I'm open to ideas 🙂🤷♂️
https://www.loom.com/share/8e965b18897a4fe58121a461898c6b42
The text was updated successfully, but these errors were encountered: