Skip to content

Commit

Permalink
Remove SearchContextProvider from Root component
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Scamporlino <me@vinzscam.dev>
  • Loading branch information
vinzscam committed Feb 10, 2022
1 parent 52d2d36 commit e725bb8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
24 changes: 24 additions & 0 deletions .changeset/bright-games-eat.md
@@ -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>
```
Expand Up @@ -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,
Expand Down Expand Up @@ -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 />}>
Expand Down

0 comments on commit e725bb8

Please sign in to comment.