You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As soon as a deck.gl layer is created in an application that uses react-three-fiber (r3f), the r3f components stop responding to events. The reason is that create-props.ts is adding _mergedDefaultProps to the global function prototype, so all functions in the VM instance have that property in their prototype. That breaks the r3f reconciler's ability to determine that an event handler function has changed, so event handlers don't get replaced in the underlying three.js objects during renders when state changes.
Flavors
Script tag
React
Python/Jupyter notebook
MapboxOverlay
GoogleMapsOverlay
CartoLayer
ArcGIS
Expected Behavior
react-three-fiber and deck.gl should be able to co-exist in an application. I suspect that _mergedDefaultProps does not need to walk the entire prototype chain and add props all the way up to the root function prototype. and should probably only add props to the prototypes of components. I have a simple proposed change (PR to follow) that prevents deck.gl from breaking r3f applications and doesn't appear to break any existing deck.gl functionality.
Steps to Reproduce
Create a r3f application with event handlers that reference component state that changes. Create a deck.gl layer (don't have to add it to a map, just new it up), and observe that the r3f component event handlers no longer update as the state changes.
Environment
Framework version: 9.0.30
Browser: all
OS: MacOS
Logs
No response
The text was updated successfully, but these errors were encountered:
Description
As soon as a deck.gl layer is created in an application that uses react-three-fiber (r3f), the r3f components stop responding to events. The reason is that create-props.ts is adding _mergedDefaultProps to the global function prototype, so all functions in the VM instance have that property in their prototype. That breaks the r3f reconciler's ability to determine that an event handler function has changed, so event handlers don't get replaced in the underlying three.js objects during renders when state changes.
Flavors
Expected Behavior
react-three-fiber and deck.gl should be able to co-exist in an application. I suspect that _mergedDefaultProps does not need to walk the entire prototype chain and add props all the way up to the root function prototype. and should probably only add props to the prototypes of components. I have a simple proposed change (PR to follow) that prevents deck.gl from breaking r3f applications and doesn't appear to break any existing deck.gl functionality.
Steps to Reproduce
Create a r3f application with event handlers that reference component state that changes. Create a deck.gl layer (don't have to add it to a map, just new it up), and observe that the r3f component event handlers no longer update as the state changes.
Environment
Logs
No response
The text was updated successfully, but these errors were encountered: