Skip to content

Commit

Permalink
style: react-use 调整为默认依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
limaofeng committed Aug 27, 2021
1 parent 234b886 commit ed5f440
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"react-moveable": "^0.29.0",
"react-selecto": "^1.12.0",
"react-transition-group": "^4.4.2",
"react-use": "^17.2.4",
"scenejs": "^1.5.0",
"styled-components": "^5.3.0"
},
Expand Down Expand Up @@ -106,7 +107,6 @@
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"react-router-dom": "^5.2.0",
"react-use": "^17.2.4",
"rollup-plugin-postcss": "^4.0.0",
"size-limit": "^5.0.1",
"sunmao": "^0.2.4",
Expand Down
2 changes: 2 additions & 0 deletions src/AsanyContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function useStore(mode: AsanyProviderMode, plugins: EditorPlugin[] = []): IAsany
listeners.unshift(callback);
return handleUnsubscribe(callback);
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[listeners]
);
// TODO 后期需要优化,解决由于 hover 导致的频繁触发
Expand All @@ -67,6 +68,7 @@ function useStore(mode: AsanyProviderMode, plugins: EditorPlugin[] = []): IAsany
useEffect(() => {
store.getState = () => state;
handleDispatchSubscribe();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state]);
return store;
}
Expand Down
1 change: 1 addition & 0 deletions src/properties/combine/WrapperPopoverContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function WrapperPopoverContent(props: WrapperPopoverContentProps<any>) {
],
fields: currentFields,
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [fieldsProp]);

return (
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11527,6 +11527,7 @@ react-universal-interface@^0.6.2:
react-use@^17.2.4:
version "17.2.4"
resolved "https://registry.npmjs.org/react-use/-/react-use-17.2.4.tgz#1f89be3db0a8237c79253db0a15e12bbe3cfeff1"
integrity sha512-vQGpsAM0F5UIlshw5UI8ULGPS4yn5rm7/qvn3T1Gnkrz7YRMEEMh+ynKcmRloOyiIeLvKWiQjMiwRGtdbgs5qQ==
dependencies:
"@types/js-cookie" "^2.2.6"
"@xobotyi/scrollbar-width" "^1.9.5"
Expand Down

0 comments on commit ed5f440

Please sign in to comment.