resize-observer icon indicating copy to clipboard operation
resize-observer copied to clipboard

Need to check whether element is instance of Element or not?

Open liboshi opened this issue 4 years ago • 4 comments

https://github.com/react-component/resize-observer/blob/73473bd71e84898fb94b130ec32f3cb6a7216d03/src/index.tsx#L71

Currently, error occurred when element is not an instance of Element:

'observe' on 'ResizeObserver': parameter 1 is not of type 'Element'.

liboshi avatar Dec 09 '19 02:12 liboshi

@zombieJ How about this issue? Anyone can help?

liboshi avatar Apr 09 '20 08:04 liboshi

@liboshi , could you provide a reproduce?

zombieJ avatar Apr 09 '20 10:04 zombieJ

Hi, I have the same problem. ResizeObserver throws that error also when it gets a Proxy object. Even though it proxies an object of type Element. Table component from @ant-design/pro-layout is a good example: https://stackblitz.com/edit/rc-resize-observer-bug?file=src%2FApp.js

tomaszcoding avatar Nov 23 '23 14:11 tomaszcoding

Oh, it's actually a problem of resize-observer-polyfill, not the resize-observer itself: https://github.com/que-etc/resize-observer-polyfill/issues/95 To solve it, simply put a div directly inside the ResizeObserver and place the rest inside the div.

tomaszcoding avatar Nov 23 '23 15:11 tomaszcoding