[Bug] React 19 Activity component support
@charlieforward9 is already working on this.
Since Feb 20, 2026.
- Dominant language
- TypeScript
- Stars
- 14.6k
- Forks
- 2.3k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 42
Description
Description
Summary
deck.gl's React component doesn't properly support React 19's <Activity> component. When a <DeckGL> component is hidden via Activity and then shown again, the view state resets to initialViewState, losing any user interactions (pan/zoom).
Background
React 19.2 introduced the <Activity> component which hides components without unmounting them. However, Activity has a specific behavior: effect cleanup functions run when hidden, and effects re-run when visible again (while React state is preserved).
Related
- Discussion: #9921
- React Activity docs: https://react.dev/reference/react/Activity
Flavors
- Script tag
- React
- Python/Jupyter notebook
- MapboxOverlay
- GoogleMapsOverlay
- CARTO
- ArcGIS
Expected Behavior
Deck should retain state in the hidden activity mode.
Steps to Reproduce
https://github.com/mohadib/deck-activity
This example has 2 maps and a div you can toggle between. One map uses an Activity, and the other uses css display: none when hidden. The css hiding retains state, the activity does not.
Root Cause
The DeckGL component's initialization effect (modules/react/src/deckgl.ts:189-199):
useEffect(() => {
thisRef.deck = createDeckInstance(thisRef, DeckClass, {...});
return () => thisRef.deck?.finalize();
}, []);
When Activity hides the component:
- Cleanup runs →
finalize()destroys the Deck instance and its internal view state - When shown again → A new Deck instance is created with the original
initialViewState - User's pan/zoom changes are lost
Environment
- Framework version: 9.2
- Browser: Chrome
- OS: MacOS
Logs
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.