Skip to content

Commit 81bda84

Browse files
fix: unmount react root alongside with qwik (#7864)
1 parent aa65c37 commit 81bda84

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.changeset/short-jeans-speak.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@builder.io/qwik': patch
3+
---
4+
5+
FIX: unmount qwikify react root alongside with qwik component

packages/qwik-react/src/react/qwikify.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ export function qwikifyQrl<PROPS extends Record<any, any>>(
7878
}
7979
});
8080

81+
useTask$(({ track, cleanup }) => {
82+
track(signal);
83+
84+
if (isBrowser) {
85+
cleanup(() => {
86+
internalState.value?.root?.unmount();
87+
});
88+
}
89+
});
90+
8191
if (isServer && !isClientOnly) {
8292
const jsx = renderFromServer(
8393
TagName,

0 commit comments

Comments
 (0)