react-svg-map icon indicating copy to clipboard operation
react-svg-map copied to clipboard

RadioSVGMap broken in React 17

Open tgeorgiadis opened this issue 3 years ago • 5 comments

It appears RadioSVGMap is broken in React 17

I've made a Code Sandbox showing the error: https://codesandbox.io/s/reverent-goodall-5ox98?file=/src/App.js

Error: Minified React error #188; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=188 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

Full text of error: Unable to find node on an unmounted component.

tgeorgiadis avatar May 13 '21 06:05 tgeorgiadis

Thank you for reporting this issue @tgeorgiadis

I don't know when I have time to look at it, because currently I'm very busy. If you know how to fix it, feel free to open a PR! Btw I think your Code Sandbox is just an empty react application 🤔

VictorCazanave avatar May 15 '21 11:05 VictorCazanave

+1 on this

BossBele avatar May 31 '21 07:05 BossBele

FWIW this same issue occurs with <CheckboxSVGMap />, that said as a workaround if you use the vanilla <SVGMap /> and manage state outside of this library you can generally get the same/similar behaviour of <CheckboxSVGMap /> and <RadioSVGMap />

thomb avatar Jun 18 '21 16:06 thomb

CheckboxSVGMap seems to work with React 17: https://codesandbox.io/s/checkbox-svg-map-with-react-17-wx0pz

VictorCazanave avatar Jul 04 '21 04:07 VictorCazanave

Although I couldn't fix it in a Code Sandbox, RadioSVGMap worked in a local project with React 17.0.2.

However, in strict mode, it throws a warning, because the deprecated ReactDOM.findDOMNode() in still used in RadioSVGMap and couldn't be replaced by ref since it's not supported on functional components in React 16.0.0.

@tgeorgiadis @BossBele if you got the error in a local project, could you provide a repository to reproduce it please?

VictorCazanave avatar Jul 04 '21 08:07 VictorCazanave