react-scroll icon indicating copy to clipboard operation
react-scroll copied to clipboard

React-scroll not working with Material UI 5 Tabs - Cannot read property 'addEventListener' of undefined

Open sufius opened this issue 4 years ago • 4 comments

Hello here is a working example with Material-UI 4

https://codesandbox.io/s/cranky-tess-xd72g

And here the same code with Material-UI 5 - not working

https://codesandbox.io/s/crazy-jasper-5ozl5

Error-Message: Cannot read property 'addEventListener' of undefined

Thank you.

sufius avatar Aug 27 '21 23:08 sufius

Ive got the same problem after updating to Mui5.

prKrumm avatar Oct 16 '21 05:10 prKrumm

solution?? :(

AlexCernik avatar Oct 24 '21 07:10 AlexCernik

Wrap it in forwardRef and use component={SLink}.

const SLink = forwardRef((props, ref) => <Link {...props}/>);

chrmoritz avatar Nov 29 '21 22:11 chrmoritz

@chrmoritz Thank you, it worked:

https://codesandbox.io/s/nifty-waterfall-en9to

Unfortunately there is now this error message:

Warning: React does not recognize the innerRef prop on a DOM element.

sufius avatar Nov 30 '21 00:11 sufius