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: Multiple jsx elements with different props end up getting the same props on hydration #2294

Closed
Kilian opened this issue Dec 30, 2021 · 6 comments · Fixed by #2825
Closed

Comments

@Kilian
Copy link

Kilian commented Dec 30, 2021

What version of astro are you using?

0.22.2

What package manager are you using?

npm, yarn

What operating system are you using?

Linux

Describe the Bug

When a JSX component is instantiated in different places with different props, they end up getting the same Astro uid and the same props.

This seems to be the same bug as #844 and #846.

The example below is structured as follows:

  • index page
    • GridBlock.astro
      • Tickercard.astro 1
        • Ticker.jsx
      • Tickercard.astro 2
        • Ticker.jsx

The props are set in GridBlock.astro and then sent down to Ticker.jsx

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-fkwapp?file=src%2Fcomponents%2FGridBlock.astro

@Kilian Kilian changed the title 🐛 BUG: 🐛 BUG: Multiple jsx elements with different props end up getting the same props on hydration Dec 30, 2021
@WebDevSimplified
Copy link

I am also running into this exact same issue. It appears that the components are rendering exponentially. If I try to render 3 of the same component it will hydrate the component 9 times on the client when it should only be 3. I am guessing this is what is leading to the bug.

@jonathantneal
Copy link
Contributor

Verified! Great example, @Kilian. You are correct about the IDs matching, as well. We’ll get this fixed.

@jonathantneal jonathantneal self-assigned this Jan 4, 2022
@diegoleme
Copy link
Contributor

This also happens to me. I'm using vue.js.

@Kilian
Copy link
Author

Kilian commented Feb 15, 2022

@jonathantneal do you have any leads yet, or a workaround?

@yusufhilmi
Copy link

yusufhilmi commented Mar 8, 2022

Any updates to this bug? It happens with Vue components as well.

@FredKSchott
Copy link
Member

Update: I can still reproduce in v0.24.0

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

Successfully merging a pull request may close this issue.

6 participants