mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
Update use-store.md (#2799)
there is a typo mistake while importing the setposition from positionstore wrong : const setPosition = useStore(positionStore, (state) => state.setPositionStore) correct : const setPosition = useStore(positionStore, (state) => state.setPosition)
This commit is contained in:
parent
cce8d5b22e
commit
f9b5538402
@ -70,7 +70,7 @@ will use the store to track and update the dot's position.
|
||||
```tsx
|
||||
function MovingDot() {
|
||||
const position = useStore(positionStore, (state) => state.position)
|
||||
const setPosition = useStore(positionStore, (state) => state.setPositionStore)
|
||||
const setPosition = useStore(positionStore, (state) => state.setPosition)
|
||||
|
||||
return (
|
||||
<div
|
||||
@ -131,7 +131,7 @@ const positionStore = createStore<PositionStore>()((set) => ({
|
||||
|
||||
function MovingDot() {
|
||||
const position = useStore(positionStore, (state) => state.position)
|
||||
const setPosition = useStore(positionStore, (state) => state.setPositionStore)
|
||||
const setPosition = useStore(positionStore, (state) => state.setPosition)
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user