Skip to content

Commit

Permalink
fix: lint visual editor
Browse files Browse the repository at this point in the history
  • Loading branch information
demshy committed Jun 27, 2023
1 parent ea2ece0 commit 5dfe3a4
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ function Editor(props) {
onChange,
} = props;

const editor = useMemo(() =>
withReact(withShortcodes(withBlocks(withLists(withInlines(createEditor()))))), []
const editor = useMemo(
() => withReact(withShortcodes(withBlocks(withLists(withInlines(createEditor()))))),
[],
);

const emptyValue = [defaultEmptyBlock()];
Expand Down Expand Up @@ -175,15 +176,15 @@ function Editor(props) {
}
const [toolbarKey, setToolbarKey] = useState(0);

const handleDocumentChange = debounce(newValue => {
setEditorValue(() => newValue);
onChange(
slateToMarkdown(newValue, {
voidCodeBlock: !!codeBlockComponent,
remarkPlugins: getRemarkPlugins(),
}),
);
}, 150);
// const handleDocumentChange = debounce(newValue => {
// setEditorValue(() => newValue);
// onChange(
// slateToMarkdown(newValue, {
// voidCodeBlock: !!codeBlockComponent,
// remarkPlugins: getRemarkPlugins(),
// }),
// );
// }, 150);

function handleChange(newValue) {
if (!isEqual(newValue, editorValue)) {
Expand Down

0 comments on commit 5dfe3a4

Please sign in to comment.