Skip to content
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 not updating dom while using "variable.value" but does when using "variable" #469

Closed
KillerMax4299 opened this issue Dec 19, 2023 · 9 comments

Comments

@KillerMax4299
Copy link

KillerMax4299 commented Dec 19, 2023

This doesn't update the count value in the button

image

But this does

image

But both should work right. Later was just an optimization (optional)

I found this issue in @preact/signals-react v2.0.0 but while in v1.3.8 everything works fine. So for the time being I'm just using the older version.

@KillerMax4299 KillerMax4299 changed the title @preact/signals-react not updating dom while using "variable.value" but does when using @preact/signals-react not updating dom while using "variable.value" but does when using "variable" Dec 19, 2023
@andrewiggins
Copy link
Member

Hey @KillerMax4299 👋 v2 is a new major release of signals-react and as such has some breaking changes. Check the Changelog for details on the breaking change.

Have you added import "@preact/signals-react/auto"; to the root of your application? That's the fastest way to get the same behavior as v1.3.8.

Just realizing I updated the Readme with the new instructions but didn't but a larger notice about the v2 changes. Lemme do that.

@hta218
Copy link

hta218 commented Dec 22, 2023

Hey @andrewiggins, added import "@preact/signals-react/auto" does work. Thanks for mentioning that.

The v2.0.0 changelog says: "Check out the new Readme for the newly supported ways of using signals in React". But where is the new ReadMe?
image

@XantreDev
Copy link
Contributor

@noopurphalak
Copy link

@XantreGodlike No useSignals hook is exported in the @preact/signals-react in version 2.0.0

Screenshot 2023-12-27 at 5 00 13 PM

@XantreDev
Copy link
Contributor

XantreDev commented Dec 27, 2023

@XantreGodlike No useSignals hook is exported in the @preact/signals-react in version 2.0.0

Screenshot 2023-12-27 at 5 00 13 PM

It've been never exported from the main entry

@noopurphalak
Copy link

noopurphalak commented Dec 28, 2023

@XantreGodlike No useSignals hook is exported in the @preact/signals-react in version 2.0.0
Screenshot 2023-12-27 at 5 00 13 PM

I've never been exported from the main entry

Well, the documentation asks to import useSignals from @preact/signals-react and when I try to do that, it gives me an error. Refer the screenshot below for the documentation where it is mentioned:

Screenshot 2023-12-28 at 12 29 14 PM

@XantreDev
Copy link
Contributor

@noopurphalak
Copy link

@XantreGodlike Okay, got it...

fanesz added a commit to fanesz/react-signals that referenced this issue Dec 31, 2023
@besabellacyrus
Copy link

Hey @KillerMax4299 👋 v2 is a new major release of signals-react and as such has some breaking changes. Check the Changelog for details on the breaking change.

Have you added import "@preact/signals-react/auto"; to the root of your application? That's the fastest way to get the same behavior as v1.3.8.

Just realizing I updated the Readme with the new instructions but didn't but a larger notice about the v2 changes. Lemme do that.

adding this one inside App.js works too. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants