react-cursor-position icon indicating copy to clipboard operation
react-cursor-position copied to clipboard

Compatibility with React 16

Open davidhatten opened this issue 5 years ago • 3 comments

One of the minor versions of React 16 (I think, 16.2?) changed the typeof response from function to object. This causes the method getIsReactComponent(reactElement) to return false, thereby causing the intended wrapped element to not have the position properties not added to its props.

davidhatten avatar Aug 05 '19 14:08 davidhatten

@davidhatten are you aware of any way to avoid this issue, until this library gets updated? Or do I need to (a) hold off on updating react or (b) find an alternative to react-cursor-position?

carpiediem avatar Jun 18 '20 08:06 carpiediem

@carpiediem I yanked it out of my project for the time being and manually implemented the functionality I needed. Not sure what you're doing, but I grabbed the x and y position from the event and then had to do some SVG handling.

https://github.com/davidhatten/geometric-drawer/blob/master/webpack/containers/Canvas.js#L23

davidhatten avatar Jun 18 '20 11:06 davidhatten

Got it, thanks. Not too hard for position

carpiediem avatar Jun 18 '20 12:06 carpiediem