Skip to content

fix(react): reset removed props, and warn about props that only apply at creation - #11267

Merged
chrisgervang merged 6 commits into
masterfrom
chr/react-reset-removed-props
Nov 22, 2026
Merged

chrisgervang merged 6 commits into
masterfrom
chr/react-reset-removed-props

Conversation

@chrisgervang

@chrisgervang chrisgervang commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

For #11036

Background

Replays visgl/deck.gl-community#1088 onto @deck.gl/react. Deck.setProps merges into the props it holds, so a prop a render stops passing kept its old value. With #10906, Deck falls back to the default for a prop passed as undefined, so the root only resets removed props. The community PR's yarn patch isn't needed here.

Change List

TODO


Note

Low Risk
Updates React reconciler prop synchronization for Deck.gl instances; changes are isolated to @deck.gl/react and accompanied by comprehensive tests.

Overview
Updates the React reconciler in @deck.gl/react to reset omitted props back to their Deck.defaultProps values on re-renders. Because Deck.setProps merges into existing configuration, previously removed props retained their prior values instead of reverting to defaults.

Additionally, warns in development when props that only apply at instance creation (such as gl, touchAction, and deviceProps) change between renders. Also updates combineRootDescriptors so external overlays that do not forward JSX views properly respect and reset their own views prop.

Reviewed by Cursor Bugbot for commit add1bf7. Bugbot is set up for automated code reviews on this repo. Configure here.


Generated by Claude Code

… at creation

Replays visgl/deck.gl-community#1088 onto @deck.gl/react. #10906 made Deck fall
back to the default for a prop passed as undefined, so the root only resets
props that a render removed, and passes undefined through.

- A prop the last configure had and this one doesn't is sent as its Deck
  default. layers, views, widgets and effects are left out of that spread, so
  views={undefined} can't clear views that a widget such as SplitterWidget set.
- An overlay that doesn't forward JSX views follows the same views rule with
  its views prop alone.
- In development builds, changing deviceProps, gl, debug, touchAction,
  eventRecognizerOptions or _typedArrayManagerProps after creation warns once
  per prop per root, with a link to the DeckGL docs.

The community PR's yarn patch isn't needed: deck.gl builds @deck.gl/core from
source, which includes #10906. Its creation-only test runs in the jsdom react
project, where vi.stubEnv reaches process.env.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LGNhMnSJ94uYgx7ihcVwPn

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

A live Deck can't take their defaults. Deck.setProps only swaps in a new
device, so sending null left Deck rendering with its device while its props
said null. _canvases chose single- or multi-canvas mode, and Deck.setProps
asserts that the mode never changes, so sending null threw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LGNhMnSJ94uYgx7ihcVwPn

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5da98e8. Configure here.

Deck.setProps resets an explicit undefined to its default (#10906), so passing
device or _canvases as undefined hit the same problems as removing them. The
root leaves either out of setProps when it is undefined, as when it is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LGNhMnSJ94uYgx7ihcVwPn

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coveralls

coveralls commented Nov 21, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.744% (+0.03%) from 82.711% — chr/react-reset-removed-props into master

@ibgreen ibgreen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One browser-compatibility regression in the prop-reset helper.

Safari 15.0-15.3 lack Object.hasOwn, so the second configure threw there.
getRemovedProps uses Object.prototype.hasOwnProperty.call, as #11114 does, with
the same own-property semantics. A test runs two configures with Object.hasOwn
removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LGNhMnSJ94uYgx7ihcVwPn

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@ibgreen ibgreen added the bug label Nov 21, 2026
@chrisgervang
chrisgervang requested a review from ibgreen November 21, 2026 16:24
chrisgervang pushed a commit that referenced this pull request Nov 22, 2026
… renderer @deck.gl/react

- DeckGL: removed props reset to deck.gl's defaults; table of props that only
  apply at creation (from visgl/deck.gl-community#1088, code in #11267)
- Migration guide: "Removed props reset"; using-with-maps links the table
- DeckCanvas now lives in @deck.gl-community/react; link it there
- Replace "React Fiber" with @deck.gl/react or "the renderer"

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LGNhMnSJ94uYgx7ihcVwPn
Resolves the renderer.ts conflict with #11271: a prop-only update keeps
prepareRootUpdate (duplicate-id check and sentViews) and adds the removed-prop
reset and the creation-only warning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LGNhMnSJ94uYgx7ihcVwPn

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

chrisgervang commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

Two red results on add1bf7, neither from this PR:


Generated by Claude Code

@chrisgervang
chrisgervang added this pull request to the merge queue Nov 22, 2026
Merged via the queue into master with commit 2db4111 Nov 22, 2026
17 of 19 checks passed
@chrisgervang
chrisgervang deleted the chr/react-reset-removed-props branch November 22, 2026 23:02
chrisgervang added a commit that referenced this pull request Nov 23, 2026
For #11036. Closes #11037

- Renderer docs in api-reference/react and developer-guide/react; the previous API's pages are under /legacy (#11254)
- Migration guide from @deck.gl/react 9, upgrade-guide entry and what's new
- Ids: elements without an id get one from their place in the React tree (#11271)
- DeckGL: removed props reset to their defaults, and props that only apply at creation (#11267)
- Sidebar: a "Using with React" guide section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants