New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@preact/signals-react
1.3.6 is brokes useSyncExternalStoreWithSelector
#411
Comments
I'm having the same issue, I'm using
|
@diego9497 can you provide repro? Is it enough to install signals, redux toolkit and use it just once? |
Ran into this problem as well. |
It is enough to install signals in a redux toolkit project and use it just once. |
Also getting this issue, also using redux (but not not toolkit). Downgrading did solve the problem, but I don't want to be stuck on 1.2.2. Attempting to upgrade to latest version of redux and see how this affects things. |
Do you need to do something especial in rudux to have this issue. If you will provide it I will try to create test case |
I've tried to reproduce it by writing simple counter, but all is working fine. What do I need to do to reproduce this behaviour? |
Sorry... li will try to set up a test.
…On Sun, Nov 12, 2023, 12:47 AM Valerii Smirnov ***@***.***> wrote:
I've tried to reproduce it by writing simple counter, but all is working
fine. What do I need to do to reproduce this behaviour?
https://github.com/XantreGodlike/preact-signals-redux-issue
—
Reply to this email directly, view it on GitHub
<#411 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZDYABBSD2WKLHLH5HAXXTYEBPHPAVCNFSM6AAAAAA4SJNTZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBXGAYTEMRSHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Ok... so the only thing I need to do to reproduce this is add and setup react-redux in the a project. Straight up react-redux will do it... doesn't even need to be toolkit. I'm using react-redux ^8.0.2, react": "^18.2.0 and "redux": "^4.0.4", |
Seems to be this issue related with react patching. Some default behaviour of react breaks after monkeypatching and this issue appears in big projects |
Yeah... confirmed it with another project with react-redux. I just pulled signals-react in and created a signal and had the same issue. This is a huge problem for migrating. We had hoped to move our thinking gradually from redux to signals. I don't know what the repercussions of sticking with 1.2.2 until we can fully migrate are, though. |
Hi, I had the same problem. |
So you've had elements with the same key and it caused this error, isn't it?
|
Exactly, (or rather I had no key at all). So the solution in my case was to add a key (in a component that had noting to do with the signal).
|
Our next major version of signals-react (hopefully coming out in the next couple weeks) is gonna deprecate and make opt-in the current React internal patching in favor of using a Babel transform to make components reactive to signals. The transform is available now on NPM for trying out but some internal changes/fixes & more/updated documentation are needed before I consider it stable. I suspect that the transform won't have similar issues. |
@andrewiggins I don't think this approach scales well - because we will lack support of next.js. Since their babel integration is kinda legacy and not all features will work with babel (next-fonts doesn't). So seems to be we cannot rely on transform, probably there should be transform for other parsers (swc, esbuild). |
I am using
@tanstack/react-router
which usinguseSyncExternalStoreWithSelector
i've worked with this combo for week, but yesterday it started to throw inside react internals. I has really long research and fixed this issue by downgrading to1.2.2
where was no react internals patching. I dont really know how to reproduce this issue, maybe it's because signals uses sync external store tooThe text was updated successfully, but these errors were encountered: