Skip to content

Commit 3b4c22a

Browse files
committed
Fix component as props used in the same container getting the same key
1 parent 4031d0e commit 3b4c22a

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

dash/dash-renderer/src/wrapper/DashWrapper.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import {
2828
createElement,
2929
getComponentLayout,
3030
isDryComponent,
31-
checkRenderTypeProp
31+
checkRenderTypeProp,
32+
stringifyPath
3233
} from './wrapping';
3334
import Registry from '../registry';
3435
import isSimpleComponent from '../isSimpleComponent';
@@ -158,18 +159,13 @@ function DashWrapper({
158159
};
159160

160161
const createContainer = useCallback(
161-
(container, containerPath, _childNewRender, key = undefined) => {
162+
(container, containerPath, _childNewRender) => {
162163
if (isSimpleComponent(renderComponent)) {
163164
return renderComponent;
164165
}
165166
return (
166167
<DashWrapper
167-
key={
168-
(container &&
169-
container.props &&
170-
stringifyId(container.props.id)) ||
171-
key
172-
}
168+
key={stringifyPath(containerPath)}
173169
_dashprivate_error={_dashprivate_error}
174170
componentPath={containerPath}
175171
_passedComponent={container}
@@ -192,8 +188,7 @@ function DashWrapper({
192188
...childrenPath,
193189
i
194190
]),
195-
_childNewRender,
196-
i
191+
_childNewRender
197192
);
198193
}
199194
return n;

0 commit comments

Comments
 (0)