Skip to content

Conversation

@sashkashishka
Copy link
Contributor

@sashkashishka sashkashishka commented Aug 25, 2025

Close #7542

What is it?

Bug

Description

There is a bug, while navigating using SPA like approach, the qwikified react components don't call unmount callbacks specified in useEffects hooks.

There is an open issue that mentions such a problem #7542

In this PR the issue is fixed by calling unmount method in react root entity when the qwik wrapper unmounts.

I haven't added unit tests because I haven't found them. If they are needed, please let me know where to write them.

Checklist

  • My code follows the developer guidelines of this project
  • I performed a self-review of my own code
  • I added a changeset with pnpm change
  • I made corresponding changes to the Qwik docs
  • I added new tests to cover the fix / functionality

@sashkashishka sashkashishka requested a review from a team as a code owner August 25, 2025 16:43
@changeset-bot
Copy link

changeset-bot bot commented Aug 25, 2025

🦋 Changeset detected

Latest commit: 76b0aa2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@builder.io/qwik Patch
eslint-plugin-qwik Patch
@builder.io/qwik-city Patch
create-qwik Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your help @sashkashishka
Yep, it will be amazing to cover this part with tests

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 25, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@builder.io/qwik@7864
npm i https://pkg.pr.new/@builder.io/qwik-city@7864
npm i https://pkg.pr.new/eslint-plugin-qwik@7864
npm i https://pkg.pr.new/create-qwik@7864

commit: e570d5c

@github-actions
Copy link
Contributor

github-actions bot commented Aug 25, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 07c5fe0

@sashkashishka
Copy link
Contributor Author

@gioboa, sure, I'll make it

Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the solution with the provided reproduction repo, and it's working fine.

Image

Thanks so much for your help @sashkashishka 💪

@gioboa gioboa enabled auto-merge (squash) September 2, 2025 10:27
Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wmertens
Copy link
Member

wmertens commented Sep 2, 2025

I would love some tests, but you can add them in a separate PR @sashkashishka.

@sashkashishka
Copy link
Contributor Author

@gioboa, @wmertens, thank you all for approving!
Sorry for hesitating with tests. I can add them within 2 weeks

@gioboa gioboa merged commit 81bda84 into QwikDev:main Sep 2, 2025
18 checks passed
@github-actions github-actions bot mentioned this pull request Sep 4, 2025
@github-actions github-actions bot mentioned this pull request Oct 2, 2025
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 this pull request may close these issues.

[🐞] Qwik React never calls unmount.

4 participants