Skip to content

Commit

Permalink
Fix: use insertLookup.current, not just insertLookup
Browse files Browse the repository at this point in the history
  • Loading branch information
cnrudd committed Nov 3, 2023
1 parent 3fd8788 commit f12e76c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/HoistComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ function wrapWithModel(render: RenderFn, cfg: Config): RenderFn {
delete props.modelRef;
delete props.modelConfig;
ctx.props = props;
ctx.modelLookup = insertLookup ?? modelLookup;
ctx.modelLookup = insertLookup?.current ?? modelLookup;
useOnMount(() => instanceManager.registerModelWithTestId(props.testId, model));
useOnUnmount(() => instanceManager.unregisterModelWithTestId(props.testId));
return render(props, ref);
Expand All @@ -341,7 +341,9 @@ function wrapWithModel(render: RenderFn, cfg: Config): RenderFn {
? managedRender()
: createElement(HostCmp, {managedRender, key: model?.xhId});

return insertLookup ? modelLookupContextProvider({value: insertLookup, item: ret}) : ret;
return insertLookup?.current
? modelLookupContextProvider({value: insertLookup.current, item: ret})
: ret;
};
}

Expand Down

0 comments on commit f12e76c

Please sign in to comment.