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.
1 parent 9480474 commit 792fc24Copy full SHA for 792fc24
packages/pinia/src/store.ts
@@ -221,7 +221,9 @@ function createSetupStore<
221
let debuggerEvents: DebuggerEvent[] | DebuggerEvent
222
const initialState = pinia.state.value[$id] as UnwrapRef<S> | undefined
223
224
- if (!initialState && (!__DEV__ || !hot)) {
+ // avoid setting the state for option stores are it is set
225
+ // by the setup
226
+ if (!buildState && !initialState && (!__DEV__ || !hot)) {
227
if (isVue2) {
228
set(pinia.state.value, $id, {})
229
} else {
0 commit comments