when I create my store object separately from the hook and do not assign any type to "set", TS is showing me a type error. Is there any specific type I can throw at it or should I leave it as any? Couldn't find anything about it in the documentation.
The store looks as follows:
const templateStore = (set: any) => ({
borderRadius: 12,
drawerWidth: 250,
fontFamily: `'Roboto', sans-serif`',
headerHeight: 80,
language: 'UK',
opened: true,
setLang: (lang: string) => set({ language: lang }),
setMenu: () => set((state: TemplateStore) => ({ opened: !state.opened })),
});
And the hook:
const useTemplateStore = create<TemplateStore>()(
devtools(
persist(templateStore, {
name: 'template',
}),
),
);
I tried assigning the TemplateStore interface, which didn't work and also the any type which is not desired.