Skip to content

Commit ec7b510

Browse files
authored
fix: global number of instances flag (#2066)
1 parent 3a1a8f1 commit ec7b510

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/vanilla/store.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,9 @@ let defaultStore: Store | undefined
766766
if (import.meta.env?.MODE !== 'production') {
767767
if (typeof (globalThis as any).__NUMBER_OF_JOTAI_INSTANCES__ === 'number') {
768768
++(globalThis as any).__NUMBER_OF_JOTAI_INSTANCES__
769+
} else {
770+
;(globalThis as any).__NUMBER_OF_JOTAI_INSTANCES__ = 1
769771
}
770-
;(globalThis as any).__NUMBER_OF_JOTAI_INSTANCES__ = 1
771772
}
772773

773774
export const getDefaultStore = () => {

0 commit comments

Comments
 (0)