Destroys context
See original GitHub issueI’m using redux to connect child elements in my scene.
This one took a few hours to track down. I have a simple component connected to redux, like:
@connect(state => ({}))
class MyFriend extends Component {
render() {
return null;
}
}
If I render it outside a <Canvas>, it works fine:
<div>
<MyFriend />
<Canvas />
</div>
However if I render it inside a Canvas:
<div>
<Canvas>
<MyFriend />
</Canvas>
</div>
Then the app crashes:
Uncaught Invariant Violation: Could not find “store” in the context of “Connect(MyFriend)”
I suspect it’s related to the custom rendering here, but I’m still digging into it: https://github.com/drcmda/react-three-fiber/blob/master/src/canvas.js#L197-L204
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Creating and Destroying a Context
The Context interface contains methods for creating and destroying a subcontext, a context that is bound in another context of the same type....
Read more >context.destroy() • Waypoints - I Make Web Things
This destroys every waypoint in the context, and consequently unbinds any scroll and resize handlers attached to this context's element.
Read more >agc context destroy | Amazon Genomics CLI
Destroy contexts in the current project. Synopsis. destroy is for destroying one or more contexts. It destroys AGC resources in AWS. agc context...
Read more >when an execution context is destroyed ... - DEV Community
when an execution context is destroyed, it destroys the variable and functions defined inside them. Unless you take into account the concept ...
Read more >Puppeteer Execution context was destroyed, most likely ...
I am facing this problem in puppeteer in a for loop when i go on another page to get data, then when i...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This didn’t work either:
I’m not sure if this is related to the
useEffect()call internally, or the.memo()of the Canvas component?This works (I think), which should probably give me a clue as to what’s going on. It’s not ideal:
@JustFly1984 We rolled out a
useContextBridgehook in the @react-three/drei package for official use within the react-three-fiber ecosystem.It’s been working out really well and the api is pretty friendly 😃