Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 2bbdd4a

Browse files
authoredMay 8, 2024
Fix Reference & Manager compatibility with React 18's StrictMode (#459)
1 parent beac280 commit 2bbdd4a

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed
 

‎src/Manager.js

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function Manager({ children }: ManagerProps): React.Node {
1515

1616
const hasUnmounted = React.useRef(false);
1717
React.useEffect(() => {
18+
hasUnmounted.current = false;
1819
return () => {
1920
hasUnmounted.current = true;
2021
};

‎src/Reference.js

-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ export function Reference({ children, innerRef }: ReferenceProps): React.Node {
2222
[innerRef, setReferenceNode]
2323
);
2424

25-
// ran on unmount
26-
// eslint-disable-next-line react-hooks/exhaustive-deps
27-
React.useEffect(() => () => setRef(innerRef, null), []);
28-
2925
React.useEffect(() => {
3026
warning(
3127
Boolean(setReferenceNode),

0 commit comments

Comments
 (0)