Remove SearchContextProvider from Root component
Signed-off-by: Vincenzo Scamporlino <me@vinzscam.dev>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
---
|
||||
'@backstage/create-app': patch
|
||||
---
|
||||
|
||||
Remove SearchContextProvider from `<Root />`
|
||||
|
||||
The `SidebarSearchModal` exported from `plugin-search` internally renders `SearchContextProvider`, so it can be removed from `Root.tsx`:
|
||||
|
||||
```diff
|
||||
-import {
|
||||
- SidebarSearchModal,
|
||||
- SearchContextProvider,
|
||||
-} from '@backstage/plugin-search';
|
||||
+import { SidebarSearchModal } from '@backstage/plugin-search';
|
||||
|
||||
... omitted ...
|
||||
|
||||
<SidebarGroup label="Search" icon={<SearchIcon />} to="/search">
|
||||
- <SearchContextProvider>
|
||||
- <SidebarSearchModal />
|
||||
- </SearchContextProvider>
|
||||
+ <SidebarSearchModal />
|
||||
</SidebarGroup>
|
||||
```
|
||||
@@ -28,10 +28,7 @@ import {
|
||||
Settings as SidebarSettings,
|
||||
UserSettingsSignInAvatar,
|
||||
} from '@backstage/plugin-user-settings';
|
||||
import {
|
||||
SidebarSearchModal,
|
||||
SearchContextProvider,
|
||||
} from '@backstage/plugin-search';
|
||||
import { SidebarSearchModal } from '@backstage/plugin-search';
|
||||
import {
|
||||
Sidebar,
|
||||
sidebarConfig,
|
||||
@@ -84,9 +81,7 @@ export const Root = ({ children }: PropsWithChildren<{}>) => (
|
||||
<Sidebar>
|
||||
<SidebarLogo />
|
||||
<SidebarGroup label="Search" icon={<SearchIcon />} to="/search">
|
||||
<SearchContextProvider>
|
||||
<SidebarSearchModal />
|
||||
</SearchContextProvider>{' '}
|
||||
<SidebarSearchModal />
|
||||
</SidebarGroup>
|
||||
<SidebarDivider />
|
||||
<SidebarGroup label="Menu" icon={<MenuIcon />}>
|
||||
|
||||
Reference in New Issue
Block a user