fix: react infinite depth error
This commit is contained in:
19 files changed
+377
-370
No files matched your search
@@ -1,9 +1,14 @@
|
||||
import { create } from "zustand";
|
||||
import { shallow } from "zustand/shallow";
|
||||
import { createWithEqualityFn } from "zustand/traditional";
|
||||
|
||||
const useSettingsStore = create(() => ({
|
||||
dialogOpen: false,
|
||||
tabValue: 0,
|
||||
}));
|
||||
const useSettingsStore = createWithEqualityFn(
|
||||
() => ({
|
||||
dialogOpen: false,
|
||||
tabValue: 0,
|
||||
}),
|
||||
shallow,
|
||||
);
|
||||
|
||||
const setDialogOpen = (dialog: boolean) =>
|
||||
useSettingsStore.setState((state) => ({ ...state, dialogOpen: dialog }));
|
||||
|
||||
Reference in new issue
Block a user