Skip to content

Commit

Permalink
docs: wrap context menu guideline with BrowserOnly to make it work wi…
Browse files Browse the repository at this point in the history
…th SSR
  • Loading branch information
tkajtoch committed Oct 23, 2024
1 parent bdb0e9a commit 6b2530e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,15 @@ Two buttons are optimal for a side-by-side layout, three is rare. For more butto

```mdx-code-block
import ContextMenu from './guidelines_context_menu';
import BrowserOnly from '@docusaurus/BrowserOnly';
```

<EuiFlexGroup gutterSize="m">
<Guideline type="do" text="Put multiple actions inside a menu triggered by a single rather than showing them separately.">
<ContextMenu />
{/* ContextMenu uses EuiPopover that's SSR-incompatible */}
<BrowserOnly>
{() => <ContextMenu />}
</BrowserOnly>
</Guideline>
<Guideline type="dont" text="When there are many buttons, none matter.">
<EuiFlexGroup>
Expand Down

0 comments on commit 6b2530e

Please sign in to comment.