wip
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
"use client";
|
||||
// stores/storeContext.ts
|
||||
import { createContext, useContext } from "react";
|
||||
import { CounterStore } from "./counterStore";
|
||||
@@ -12,7 +13,7 @@ export const initializeStores = (initialData = {}) => {
|
||||
const counterStore = new CounterStore();
|
||||
|
||||
// 服务端预取数据注入
|
||||
if (initialData.counterStore) {
|
||||
if (initialData?.counterStore) {
|
||||
counterStore.count = initialData.counterStore.count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user