Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix typos in code examples in the document #3042

Merged
merged 1 commit into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/hooks/use-shallow.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Finally, we combine both components in the `App` component to see them in action
export default function App() {
return (
<>
<UpdateBabyBearPorridge />
<UpdateBabyBearMeal />
<BearNames />
</>
)
Expand Down Expand Up @@ -186,7 +186,9 @@ the state change:

```tsx
function BearNames() {
const names = useBearFamilyStore(useShallow((state) => Object.keys(state)))
const names = useBearFamilyMealsStore(
useShallow((state) => Object.keys(state)),
)

return <div>{names.join(', ')}</div>
}
Expand Down
5 changes: 4 additions & 1 deletion docs/middlewares/immer.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ const personStore = createStore<PersonStore>()(
},
setPerson: (nextPerson) =>
set((state) => {
state.person = typeof nextPerson ? nextPerson(state.person) : nextPerson
state.person =
typeof nextPerson === 'function'
? nextPerson(state.person)
: nextPerson
}),
})),
)
Expand Down