Skip to content

Fix component as props used in the same container getting the same key #3284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 17, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions dash/dash-renderer/src/wrapper/DashWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import {
createElement,
getComponentLayout,
isDryComponent,
checkRenderTypeProp
checkRenderTypeProp,
stringifyPath
} from './wrapping';
import Registry from '../registry';
import isSimpleComponent from '../isSimpleComponent';
Expand Down Expand Up @@ -158,18 +159,13 @@ function DashWrapper({
};

const createContainer = useCallback(
(container, containerPath, _childNewRender, key = undefined) => {
(container, containerPath, _childNewRender) => {
if (isSimpleComponent(renderComponent)) {
return renderComponent;
}
return (
<DashWrapper
key={
(container &&
container.props &&
stringifyId(container.props.id)) ||
key
}
key={stringifyPath(containerPath)}
_dashprivate_error={_dashprivate_error}
componentPath={containerPath}
_passedComponent={container}
Expand All @@ -192,8 +188,7 @@ function DashWrapper({
...childrenPath,
i
]),
_childNewRender,
i
_childNewRender
);
}
return n;
Expand Down