1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 10:29:48 +02:00

fix portals in ssr, fixes #3525

This commit is contained in:
Ian Storm Taylor
2021-03-31 15:14:54 -04:00
parent a21b6739e3
commit 4ca9591015

View File

@@ -167,7 +167,9 @@ export const Menu = React.forwardRef(
)
export const Portal = ({ children }) => {
return ReactDOM.createPortal(children, document.body)
return typeof document === 'object'
? ReactDOM.createPortal(children, document.body)
: null
}
export const Toolbar = React.forwardRef(