Skip to content
Snippets Groups Projects
Commit 65db3900 authored by chris's avatar chris
Browse files

useMemo on notes

parent ef61b67a
No related branches found
No related tags found
1 merge request!168Fix rerender notes
/* eslint react/prop-types: 0 */
import React, { useEffect, useRef, useContext, useState } from 'react';
import React, { useEffect, useRef, useContext, useMemo } from 'react';
import { filter } from 'lodash';
import { EditorView } from 'prosemirror-view';
import { EditorState, TextSelection } from 'prosemirror-state';
......@@ -139,6 +139,9 @@ export default ({ node, view }) => {
);
}
}
return <NoteEditorContainer ref={editorRef} />;
const MemorizedComponent = useMemo(
() => <NoteEditorContainer ref={editorRef} />,
[],
);
return <>{MemorizedComponent}</>;
};
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment