Skip to content

Commit a1757f6

Browse files
committed
fixup: move provider ordering, pass initial props to providers
1 parent 3e0c612 commit a1757f6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/compass-workspaces/src/components/workspace-tab-context-provider.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ const WorkspaceTabContextProvider: React.FunctionComponent<
109109
children = React.cloneElement(children, initialProps);
110110
}
111111

112+
// The ordering of the these providers is important,
113+
// the workspace provider needs access to the
114+
// connection info and namespace providers.
115+
children = (
116+
<WorkspaceProvider {...initialProps}>{children}</WorkspaceProvider>
117+
);
118+
112119
if ('namespace' in tab) {
113120
children = (
114121
<NamespaceProvider
@@ -142,7 +149,7 @@ const WorkspaceTabContextProvider: React.FunctionComponent<
142149
localAppRegistry={getLocalAppRegistryForTab(tab.id)}
143150
deactivateOnUnmount={false}
144151
>
145-
<WorkspaceProvider>{children}</WorkspaceProvider>
152+
{children}
146153
</AppRegistryProvider>
147154
</WorkspaceTabStateProvider>
148155
);

0 commit comments

Comments
 (0)