diff --git a/src/stories/Overlay.stories.tsx b/src/stories/Overlay.stories.tsx index e2dbcd31640..a686f66caf6 100644 --- a/src/stories/Overlay.stories.tsx +++ b/src/stories/Overlay.stories.tsx @@ -3,6 +3,7 @@ import React, {useState, useRef} from 'react' import {Meta} from '@storybook/react' import styled from 'styled-components' +import {registerPortalRoot} from '../Portal' import {BaseStyles, Overlay, Button, Text, ButtonDanger, ThemeProvider, Position, Flex} from '..' export default { @@ -10,6 +11,9 @@ export default { component: Overlay, decorators: [ Story => { + // Since portal roots are registered globally, we need this line so that each storybook + // story works in isolation. + registerPortalRoot(undefined) return (