diff --git a/.changeset/short-jeans-speak.md b/.changeset/short-jeans-speak.md new file mode 100644 index 00000000000..f7a98e51ae2 --- /dev/null +++ b/.changeset/short-jeans-speak.md @@ -0,0 +1,5 @@ +--- +'@builder.io/qwik': patch +--- + +FIX: unmount qwikify react root alongside with qwik component diff --git a/packages/qwik-react/src/react/qwikify.tsx b/packages/qwik-react/src/react/qwikify.tsx index fb2add717a8..5679f70ed37 100644 --- a/packages/qwik-react/src/react/qwikify.tsx +++ b/packages/qwik-react/src/react/qwikify.tsx @@ -78,6 +78,16 @@ export function qwikifyQrl>( } }); + useTask$(({ track, cleanup }) => { + track(signal); + + if (isBrowser) { + cleanup(() => { + internalState.value?.root?.unmount(); + }); + } + }); + if (isServer && !isClientOnly) { const jsx = renderFromServer( TagName,