Comments (7)
Type 'BearSlice' does not satisfy the constraint 'StoreApi<BearSlice & FishSlice>'.
Type 'BearSlice' is missing the following properties from type 'StoreApi<BearSlice & FishSlice>': setState, getState, subscribe, destroyts(2344)
interface BearSlice
No quick fixes available
Type '{ bears: number; addBear: () => any; eatFish: () => any; }' is not assignable to type 'BearSlice & FishSlice'.
Type '{ bears: number; addBear: () => any; eatFish: () => any; }' is missing the following properties from type 'FishSlice': fishes, addFishts(2322)
vanilla.d.ts(33, 163): The expected type comes from the return type of this signature.
(property) BearSlice.addBear: () => void
Module '"zustand"' has no exported member 'create'. Did you mean to use 'import create from "zustand"' instead?ts(2614)
import create
No quick fixes available
from zustand.
@buzzdead btw, now there's a package called zustand-slices that helps you with that. Give it a try a let us know
from zustand.
That seemed to take away all the errors i had, just installing the package.
from zustand.
We know that typing slices is a bit tricky. BTW, we are working on revamping docs.
from zustand.
Worked like a charm after installing the package. Thanks for the lightning fast response.
You really should put in the documentation that the package is necessary though, didn't find any guides, help from any ai or stackoverflow\reddit thread to help me with this. Got pretty close to going back to another state management system.
Anyway, Ill continue with sustand.
from zustand.
Worked like a charm after installing the package. Thanks for the lightning fast response. You really should put in the documentation that the package is necessary though, didn't find any guides, help from any ai or stackoverflow\reddit thread to help me with this. Got pretty close to going back to another state management system.
Anyway, Ill continue with sustand.
It's not necessary but is an option now
from zustand.
Anyway, next time make sure you share a typescript playground link when you face typescript issues or try to format your code so would be easy to read
from zustand.
Related Issues (20)
- Re-render issue while performing open and setOpen using shadcn
- Re-render issue while performing open and setOpen using shadcn HOT 1
- type WithoutCallSignature<T>
- docs: Add suggestions about getInitialState on persist
- Cant user Array of Map type to store data
- overview of the zustand API HOT 1
- Persist storage : values are converted to strings before replacer
- Value is empty on initial render and sets after few milliseconds
- Immer Middelware Typescript error: Exported variable 'useMyStore' has or is using name 'WritableDraft' from external module "../node_modules/immer/dist/immer" but cannot be named.
- blacklist and whitelist
- Argument of type '(state: ClientStore) => Client | undefined' is not assignable to parameter of type 'ClientStore | Partial<ClientStore> | ((state: ClientStore) => ClientStore | Partial<ClientStore>)'. Type '(state: ClientStore) => Client | undefined' is not assignable to type '(state: ClientStore) => ClientStore | Partial<ClientStore>'. Type 'Client | undefined' is not assignable to type 'ClientStore | Partial<ClientStore>'. Type 'undefined' is not assignable to type 'ClientStore | Partial<ClientStore>'.ts(2345)
- The value I save to storage with persist is delayed when the page refreshes.
- State updated in one component but not in another one
- Setting nested state make the other states change (their values didn't change)
- zustand concurrent update issue
- Typo in GitHub "About" HOT 1
- import { create ,WritableDraft} from "zustand" HOT 1
- Introduction Zustand page a documentation typo HOT 1
- Ts error on type annotation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zustand.