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

use-deep-compare-effect

parent 172ea43c
No related branches found
No related tags found
1 merge request!143Track changes
......@@ -21,6 +21,7 @@
"react-transition-group": "^4.3.0",
"styled-components": "^4.2.0",
"uuid": "^7.0.3",
"use-deep-compare-effect": "^1.3.1",
"wax-prosemirror-core": "^0.0.13",
"wax-prosemirror-utilities": "^0.0.13",
"wax-prosemirror-themes": "^0.0.13"
......
......@@ -6,6 +6,7 @@ import React, {
useMemo,
useCallback,
} from 'react';
import useDeepCompareEffect from 'use-deep-compare-effect';
import { each, uniqBy, sortBy } from 'lodash';
import { WaxContext } from 'wax-prosemirror-core';
import { DocumentHelpers } from 'wax-prosemirror-utilities';
......@@ -124,7 +125,7 @@ export default ({ area }) => {
return allCommentsTop;
});
useEffect(() => {
useDeepCompareEffect(() => {
setMarksNodes(updateMarks(view));
if (isFirstRun) {
setTimeout(() => {
......@@ -134,7 +135,7 @@ export default ({ area }) => {
} else {
setPosition(setTops());
}
}, [JSON.stringify(updateMarks(view)), JSON.stringify(setTops())]);
}, [updateMarks(view), setTops()]);
const CommentTrackComponent = useMemo(
() => (
......
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