maslianok / react-resize-detector

A Cross-Browser, Event-based, Element Resize Detection for React
http://maslianok.github.io/react-resize-detector/
MIT License
1.25k stars 91 forks source link

Support for StrictMode #109

Closed Martizs closed 3 years ago

Martizs commented 3 years ago

Currently when trying to use this with React.StrictMode i get this error: 'findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of ResizeDetector which is inside StrictMode' . Would really love to use StrictMode and this awesome library together.

maslianok commented 3 years ago

@Martizs please make sure you've read and understood this part of README https://github.com/maslianok/react-resize-detector#refs

Simply say, you have to help the library and pass some reference to the block you want to handle resizes. Otherwise, it will use findDOMNode function and throw a warning in strict mode