Repository navigation
feat(react): give elements without an id one from their place in the React tree - #11271
Merged
Merged
Conversation
…React tree Replays visgl/deck.gl-community#1077 onto @deck.gl/react, now that #11114 keeps the default view and widget id on the props prototype. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LGNhMnSJ94uYgx7ihcVwPn
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
chrisgervang
pushed a commit
that referenced
this pull request
Nov 22, 2026
From visgl/deck.gl-community#1077. Describes #11271's behavior, so #11271 should merge first. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LGNhMnSJ94uYgx7ihcVwPn
chrisgervang
pushed a commit
that referenced
this pull request
Nov 22, 2026
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
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
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #11036
Follow up of visgl/deck.gl-community#1077, which has the reasoning and measurements (visgl/deck.gl-community#1076 has the id format and the collision proof).
Background
Layers, views, widgets and effects without an
idall get their class default, so siblings collide: deck.gl reinitializes one of them on every update and never finalizes the one it replaced. The renderer now gives each such element an id built from its React key or position, and never changes an id the app passed. #11114 made "passed an id equal to the default" detectable for views and widgets.Change List
reconciler/element-ids.ts(new): path-based ids and a dev-only duplicate-id warningshared/generated-effect-id.ts(new): marks effects that a component builtreconciler/config.ts: stores each element's path; hidden clones keep itreconciler/utils.ts: prop entries replace JSX elements by final idwrappers/factories.tsx: effect components mark their effectneeds a stable idwarningTODO
renderer.ts; the resolution keepsprepareRootUpdateand adds the removed-prop handlingNote
Medium Risk
Modifies element identification and descriptor merging in the React reconciler, directly affecting layer, view, widget, and effect lifecycle matching in deck.gl.
Overview
Automatically assigns deterministic IDs to
<deckLayer>,<deckView>,<deckWidget>, and wrapper-created effect elements that lack an explicitidprop, derived from their position and keys in the React fiber tree. This prevents ID collisions among sibling elements that previously fell back to shared class default IDs, which caused deck.gl to repeatedly reinitialize instances.The reconciler now tracks each element's fiber path on its instance, preserving generated IDs through clones, memoized renders, and Suspense fallback states. Additionally, descriptor merging is unified through
mergeByIdusing final element IDs, and a development-only check reports duplicate IDs across JSX elements and root props.Reviewed by Cursor Bugbot for commit 16baf49. Bugbot is set up for automated code reviews on this repo. Configure here.
Generated by Claude Code