
`import React from 'react';
import Layout from '../components/Layout'
import { EditorState } from "draft-js";
import createInlineToolbarPlugin from "draft-js-inline-toolbar-plugin";
import createSideToolbarPlugin from "draft-js-side-toolbar-plugin";
import Editor from "draft-js-plugins-editor";
const inlineToolbarPlugin = createInlineToolbarPlugin();
const { InlineToolbar } = inlineToolbarPlugin;
const sideToolbarPlugin = createSideToolbarPlugin();
const { SideToolbar } = sideToolbarPlugin;
const plugins = [inlineToolbarPlugin, sideToolbarPlugin]
export default function CreatePost() {
const editor = React.useRef(null);
const [editorState, setEditorState] = React.useState(
EditorState.createEmpty()
);
return (
<>
<Layout>
<Editor
editorState={editorState}
onChange={editorState => setEditorState(editorState)}
plugins={plugins}
ref={editor}
/>
<InlineToolbar />
<SideToolbar />
</Layout>
</>
)
}`
I have this issue too. as soon as i resize my browser
I have the issue as well.
Maybe it has something to do with SSR.... Next.js is known to have problems with reading window properties as it can only access the window object on the client and not on the server
https://medium.com/frontend-digest/why-is-window-not-defined-in-nextjs-44daf7b4604e
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.