docs: fix typos (#3042)

This commit is contained in:
조우혁 2025-03-10 09:10:53 +09:00 committed by GitHub
parent a90981afb5
commit 9ba6a63799
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -109,7 +109,7 @@ Finally, we combine both components in the `App` component to see them in action
export default function App() { export default function App() {
return ( return (
<> <>
<UpdateBabyBearPorridge /> <UpdateBabyBearMeal />
<BearNames /> <BearNames />
</> </>
) )
@ -186,7 +186,9 @@ the state change:
```tsx ```tsx
function BearNames() { function BearNames() {
const names = useBearFamilyStore(useShallow((state) => Object.keys(state))) const names = useBearFamilyMealsStore(
useShallow((state) => Object.keys(state)),
)
return <div>{names.join(', ')}</div> return <div>{names.join(', ')}</div>
} }

View File

@ -180,7 +180,10 @@ const personStore = createStore<PersonStore>()(
}, },
setPerson: (nextPerson) => setPerson: (nextPerson) =>
set((state) => { set((state) => {
state.person = typeof nextPerson ? nextPerson(state.person) : nextPerson state.person =
typeof nextPerson === 'function'
? nextPerson(state.person)
: nextPerson
}), }),
})), })),
) )