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

[Bug] Preact's hydrate will clear uncontrolled property(e.g.`defaultValue) #2406

Closed
ahuigo opened this issue Apr 17, 2024 · 1 comment
Closed

Comments

@ahuigo
Copy link
Contributor

ahuigo commented Apr 17, 2024

Preact's hydrate will clear uncontrolled property(e.g., defaultValue="12"), this is wrong

We could see that defaultValue="12" is cleared by client's hydrate.

I'm not sure if this is a fresh bug.

Demo:

https://fresh-demo-ahuigo.deno.dev/react/hello

Source code:

https://github.com/ahuigo/fresh-demo/blob/hydrate-bug/islands/react/hello.tsx

@rschristian
Copy link

This doesn't appear to be a hydration bug actually, as hydration shouldn't diff props, but a bug in Preact's render diffing I think.

To reproduce: Repl

Looks like render() will update the defaultValue prop but clear value

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

2 participants