Error partialize missing properties in typescript
#2344
Unanswered
feri-irawan
asked this question in
Bug report
Replies: 1 comment
-
|
Check this out: https://tsplay.dev/wX07Lw import { create } from "zustand";
import { persist } from "zustand/middleware";
type UseBoundStore = {
foo: number;
bar: number;
};
export const useBoundStore = create<UseBoundStore>()(
persist(
() => ({
foo: 0,
bar: 1,
}),
{
name: "foo",
partialize: (state) => ({ foo: state.foo }),
},
),
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This from zustand docs
But when i try to add type
I found errors:
Why the
barproperty is required?Beta Was this translation helpful? Give feedback.
All reactions