export const CardStylesStoreProvider = ({ card, children }: CardStylesStoreProviderProps) => {
const storeRef = useRef<StoreApi<CardStylesStore> | null>(null);
if (!storeRef.current) {
storeRef.current = createCardStylesStore(getInitialState(card));
}
return (
<CardStylesStoreContext.Provider value={storeRef.current}>
{children}
</CardStylesStoreContext.Provider>
);
};
export const CardStylesStoreProvider = ({ card, children }: CardStylesStoreProviderProps) => {
const storeRef = useRef<StoreApi<CardStylesStore> | null>(null);
if (!storeRef.current) {
storeRef.current = createCardStylesStore(getInitialState(card));
}
return (
<CardStylesStoreContext.Provider value={storeRef.current}>
{children}
</CardStylesStoreContext.Provider>
);
};