We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
onSSRComplete
1 parent 528d6e3 commit 582c492Copy full SHA for 582c492
1 file changed
packages/vue/src/composables/useInput.ts
@@ -41,6 +41,7 @@ import {
41
} from 'vue'
42
import { FormKitInputs } from '@formkit/inputs'
43
import { optionsSymbol } from '../plugin'
44
+import { onSSRComplete } from './onSSRComplete'
45
import { FormKitGroupValue } from 'packages/core/src'
46
import { FormKitPseudoProps } from '@formkit/core'
47
@@ -482,5 +483,11 @@ export function useInput<
482
483
*/
484
onBeforeUnmount(() => node.destroy())
485
486
+ /**
487
+ * `onBeforeUnmount` never fires during SSR, so we destroy the node here to
488
+ * free it from module-level registries and avoid leaking it across requests.
489
+ */
490
+ onSSRComplete(instance?.appContext.app, () => node.destroy())
491
+
492
return node
493
}
0 commit comments