diff --git a/packages/dendriform/src/Dendriform.tsx b/packages/dendriform/src/Dendriform.tsx index eab59e7..264a04e 100644 --- a/packages/dendriform/src/Dendriform.tsx +++ b/packages/dendriform/src/Dendriform.tsx @@ -723,6 +723,7 @@ export class Core { type MaybeReactElement = React.ReactElement|null; type BranchProps = { + id?: string; renderer: () => MaybeReactElement|MaybeReactElement[]; deps: unknown[]; }; @@ -731,7 +732,7 @@ type BranchProps = { const Branch = React.memo( // eslint-disable-next-line react/prop-types (props: BranchProps): React.ReactElement => <>{props.renderer()}, - (prevProps, nextProps) => shallowEqualArrays(prevProps.deps, nextProps.deps) + (prevProps, nextProps) => prevProps.id === nextProps.id && shallowEqualArrays(prevProps.deps, nextProps.deps) ); // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -1005,7 +1006,7 @@ export class Dendriform { const renderer = aIsRenderer ? a : b; const deps = aIsRenderer ? b : c; const form = aIsRenderer ? this : this.branch(a); - return renderer(form)} deps={deps} />; + return renderer(form)} deps={deps} />; } renderAll, K2 extends keyof Val, K3 extends keyof Val,K2>, K4 extends keyof Val,K2>,K3>, W extends Val,K2>,K3>[K4]>(path: [K1, K2, K3, K4], renderer: Renderer,P>>, deps?: unknown[]): React.ReactElement; @@ -1031,7 +1032,7 @@ export class Dendriform { }); }; - return ; + return ; } readonly(): Dendriform {