-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
react-click-outside's use of findDOMNode triggers a warning when used with React.StrictMode.
https://reactjs.org/docs/strict-mode.html
Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of PopoverDetectOutside which is inside StrictMode. Instead, add a ref directly to the element you want to reference.
("PopoverDetectOutside" is the component wrapped using react-click-outside)
Specific issue:
https://reactjs.org/docs/strict-mode.html#warning-about-deprecated-finddomnode-usage
Looking at the implementation, would it be possible to assign the ref as the result of a createRef, calling the wrappedRef callback during componentDidMount using this.ref.current?
Metadata
Metadata
Assignees
Labels
No labels