Skip to content

Commit 3714604

Browse files
committed
Add explicit dependency in useEffect
1 parent b301159 commit 3714604

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/components/src/validated-form-controls/control-with-error.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function UnforwardedControlWithError< C extends React.ReactElement >(
107107

108108
validityTarget?.addEventListener( 'invalid', handler );
109109
return () => validityTarget?.removeEventListener( 'invalid', handler );
110-
} );
110+
}, [ getValidityTarget ] );
111111

112112
// Handle validity messages.
113113
useEffect( () => {

0 commit comments

Comments
 (0)