visgl / visgl/deck.gl

[Bug] React 19 Activity component support

Open
#9,983 0 comments 4 reactions 2 assignees View on GitHub

@charlieforward9 is already working on this.

Since Feb 20, 2026.

bug
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
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:

  1. Cleanup runs → finalize() destroys the Deck instance and its internal view state
  2. When shown again → A new Deck instance is created with the original initialViewState
  3. User's pan/zoom changes are lost
Environment
  • Framework version: 9.2
  • Browser: Chrome
  • OS: MacOS
Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.