Skip to content

Commit 9ba6a63

Browse files
authored
docs: fix typos (#3042)
1 parent a90981a commit 9ba6a63

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

docs/hooks/use-shallow.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Finally, we combine both components in the `App` component to see them in action
109109
export default function App() {
110110
return (
111111
<>
112-
<UpdateBabyBearPorridge />
112+
<UpdateBabyBearMeal />
113113
<BearNames />
114114
</>
115115
)
@@ -186,7 +186,9 @@ the state change:
186186

187187
```tsx
188188
function BearNames() {
189-
const names = useBearFamilyStore(useShallow((state) => Object.keys(state)))
189+
const names = useBearFamilyMealsStore(
190+
useShallow((state) => Object.keys(state)),
191+
)
190192

191193
return <div>{names.join(', ')}</div>
192194
}

docs/middlewares/immer.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ const personStore = createStore<PersonStore>()(
180180
},
181181
setPerson: (nextPerson) =>
182182
set((state) => {
183-
state.person = typeof nextPerson ? nextPerson(state.person) : nextPerson
183+
state.person =
184+
typeof nextPerson === 'function'
185+
? nextPerson(state.person)
186+
: nextPerson
184187
}),
185188
})),
186189
)

0 commit comments

Comments
 (0)