selection icon indicating copy to clipboard operation
selection copied to clipboard

Issues with React 19

Open titouancreach opened this issue 1 year ago • 3 comments

What is the problem?

Hello, I have issue with using this package (React version with React 19).

Error: Cannot read properties of undefined (reading 'ReactCurrentDispatcher')
    at eval (viselect.mjs:250:15)
    at gr (viselect.mjs:661:4)
    at eval (viselect.mjs:663:26)

What is the current behavior?

The current behavior is that it throw with the exception I pasted above.


I've done some ressearch and it appears that is the problem when we use multiple React Version together. So, I've copy/pasted the file SelectionArea.tsx directly into my project and installed vanilla package directly, and it worked ! (and that's ok for me).

I think a good way (and modern way) to distribute the React package should be to only transpile the tsx to jsx. I believe all people that use react have already a bundler and, the file would be build and run with the current version of React.

Anyway, it works and it does exactly what I was looking for thank you !

Please provide the steps to reproduce and create a CodeSandbox.

What is the expected behavior?

Your environment:

titouancreach avatar Jun 13 '24 08:06 titouancreach

React 19 isn't released as stable yet.

AugustinasMK avatar Jun 13 '24 14:06 AugustinasMK

I second this @AugustinasMK, I'm currently only building this against stable versions.

simonwep avatar Jul 02 '24 11:07 simonwep

maybe we can anticipate a little bit and not wait for the user to complain to start to think to a fix

titouancreach avatar Jul 02 '24 12:07 titouancreach

I have the same issues with React 19

jin-benben avatar Dec 28 '24 05:12 jin-benben

Huh, I just tested this with React v19 by upgrading all dependencies and opening the react demo and it worked flawlessly. Can anyone confirm that because otherwise it might be something else not related to this library. There are no deprecated things used from react at the moment.

simonwep avatar Dec 31 '24 14:12 simonwep

Huh, I just tested this with React v19 by upgrading all dependencies and opening the react demo and it worked flawlessly. Can anyone confirm that because otherwise it might be something else not related to this library. There are no deprecated things used from react at the moment.

look at this demo, it can't work.

https://stackblitz.com/edit/react-tmsycz8r?file=package.json

jin-benben avatar Jan 03 '25 07:01 jin-benben