I'm using the useEditor
function from the TipTap library to create an editor, but it returns null at first. What I mean is, if I used useEditor
and immediately logged the variable I set it to, it returns null, but it returns an Editor object afterwards. I'm using React with create-react-app.
I have this in my App.js file:
const editorUse = useEditor({
extensions: [StarterKit],
content: JSON.parse(localStorage.getItem("text")) ?? "",
});
console.log(editorUse);
Code sandbox: https://codesandbox.io/s/zealous-darwin-iswww?file=/src/App.js