Using useContext hook within <Canvas>October 14, 2019 at 6:35pm (Edited 1 year ago)
When doing this, the application fails. Example here:
The workaround is to consume the context ouside of Canvas, then pass props down to child elements. Is that pretty much the pattern here? Took me a while to figure out what was going on and could be a possible footgun for other users of the library.
I was going to post a issue to github for this, but figure I might want to ask here first.
October 14, 2019 at 8:07pm
October 15, 2019 at 3:52pm
March 29, 2020 at 1:12am
Has there been any traction on this? It is a fairly large issue for me as my primary method of transferring data around is Context.
Nvm, I did some more searching. For anyone else discovering this issue, a solution was provided in another thread.
The suggestion was to create a new Provider within the
<Canvas />and use that to forward the previous Context. It's a little clunky imo, but it is a good enough stopgap for now.
March 29, 2020 at 8:01am