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
Using Preact, some components get rendered multiple times as duplicates #19399
Comments
|
Had a quick look at this and it's caused by calling Firing up a codesandbox it seems like React removes DOM nodes that are not in the virtual tree on hydration whereas Preact leaves them intact. |
|
that seems to be the same problem as preactjs/preact#2838 |
|
@marvinhagemeister @srdjan Thanks for taking a look! Interesting, I tried downgrading to |
|
Also seeing incorrect page content with Preact in 10.0.2. Seems like dom elements aren't correctly cleaned up on route change, downgrading to 10.0.1 fixes the issue. |
|
It seems odd to use hydrate() as a way to update existing rendered trees - if that works it's certainly relying on unspecified behavior in react. |
|
Fixed in |
|
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
When using Preact (via
next-plugin-preact), some components get rendered multiple times as duplicates.Unfortunately, I still haven't found the root cause. The only information I have right now is that the issue doesn't occur if I use React instead.
To Reproduce
Please see the following video (it's only about 1 minute) to see how to reproduce it.
https://streamable.com/nbkpuz
For references:
Expected behavior
Using Preact should have the same result with using React.
System information
Additional context
Add any other context about the problem here.
The duplicated component was rendered lazily using a combination of IntersectionObserver and
next/dynamic. The code for the component can be seen here and it is rendered here. The component basically fetches data from an API usingreact-queryand then renders some UI.The text was updated successfully, but these errors were encountered: