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: adding/removing JSX between HMR #55

Closed
lxsmnsyc opened this issue Jan 24, 2024 · 0 comments · Fixed by #56
Closed

Bug: adding/removing JSX between HMR #55

lxsmnsyc opened this issue Jan 24, 2024 · 0 comments · Fixed by #56

Comments

@lxsmnsyc
Copy link
Member

lxsmnsyc commented Jan 24, 2024

Repro is a component that returns an element with two or more children. In between saves, comment out one of the children, which may lead to the following behavior:

  • It throws an error
  • component mounts twice

This issue only exists in 0.7.0

Parcel:

  • Cannot reproduce when component returns a fragment.
  • Can reproduce when component returns an element:
    • When removing an element, the component remounts. Not a big issue.
    • When adding an element, the component behaves correctly.

Note

This works correctly

Vite:

  • Can reproduce when component returns an element or a fragment:
    • When removing an element, the component mounts twice bottom-to-top.
    • Re-adding the removed element between HMR works fine.
    • Re-adding the removed element on fresh load works fine.
@lxsmnsyc lxsmnsyc changed the title Bug: commenting out JSX Bug: adding/removing JSX between HMR Jan 24, 2024
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.

1 participant