mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
docs: fix the usage error of setPosition (#3100)
This commit is contained in:
parent
67673947d6
commit
bd58db0faf
@ -386,7 +386,7 @@ type PositionStore = PositionStoreState & PositionStoreActions
|
||||
const usePositionStore = createWithEqualityFn<PositionStore>()(
|
||||
(set) => ({
|
||||
position: { x: 0, y: 0 },
|
||||
setPosition: (nextPosition) => set(nextPosition),
|
||||
setPosition: (nextPosition) => set({ position: nextPosition }),
|
||||
}),
|
||||
shallow,
|
||||
)
|
||||
|
||||
@ -187,7 +187,7 @@ type PositionStore = PositionStoreState & PositionStoreActions
|
||||
|
||||
const usePositionStore = create<PositionStore>()((set) => ({
|
||||
position: { x: 0, y: 0 },
|
||||
setPosition: (nextPosition) => set(nextPosition),
|
||||
setPosition: (nextPosition) => set({ position: nextPosition }),
|
||||
}))
|
||||
|
||||
export default function MovingDot() {
|
||||
@ -361,7 +361,7 @@ type PositionStore = PositionStoreState & PositionStoreActions
|
||||
|
||||
const usePositionStore = create<PositionStore>()((set) => ({
|
||||
position: { x: 0, y: 0 },
|
||||
setPosition: (nextPosition) => set(nextPosition),
|
||||
setPosition: (nextPosition) => set({ position: nextPosition }),
|
||||
}))
|
||||
|
||||
export default function MovingDot() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user