Replies: 1 comment
-
I have some issues at the beginning too. I'm using slate on a production app on this way: import { createEditor, Editor as SlateEditor, Element as SlateElement, Transforms } from 'slate';
import { withHistory } from 'slate-history';
import { Editable, Slate, useSlate, withReact } from 'slate-react';
const renderElement = useCallback(props => <Element {...props} />, []);
const renderLeaf = useCallback(props => <Leaf {...props} />, []);
const [editor] = useState(() => withReact(withHistory(createEditor())));
return (
<Slate editor={editor} value={value} onChange={onChange}>
<Toolbar />
<Editable
id={id}
name={name}
placeholder={placeholder}
renderElement={renderElement}
renderLeaf={renderLeaf}
spellCheck
/>
</Slate>
); Hope this helps, if you need something, contact with me |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I tired to initiate my first slate editor by
But Editor is not imported. I installed everything as per slate documentation.
Beta Was this translation helpful? Give feedback.
All reactions