Skip to content

Commit d1dc9c9

Browse files
committed
Fix typos
1 parent 3a03c6a commit d1dc9c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/tutorials/essentials/part-8-rtk-query-advanced.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ export interface User {
412412
name: string
413413
}
414414

415-
// omit `fetchSlice` and `usersSlice`
415+
// omit `fetchUsers` and `usersSlice`
416416

417417
// highlight-start
418418
const emptyUsers: User[] = []
@@ -648,9 +648,9 @@ The last component that is reading from the old `postsSlice` is `<UserPage>`, wh
648648
649649
The `useQuery` hooks always take the cache key argument as the first parameter, and if you need to provide hook options, that must always be the second parameter, like `useSomeQuery(cacheKey, options)`. In this case, the `getUsers` endpoint doesn't have any actual cache key argument. Semantically, this is the same as a cache key of `undefined`. So, in order to provide options to the hook, we have to call `useGetUsersQuery(undefined, options)`.
650650
651-
We can use `selectFromResult` to have `<UserPage>` read just a filtered list of posts from the cache. However, in order for `selectFromResult` to avoid unnecessary re-renders, we need to ensure that whatever data we extract is memoized correctly. To do this, we should create a new selector instance that the `<UsersPage>` component can reuse every time it renders, so that the selector memoizes the result based on its inputs.
651+
We can use `selectFromResult` to have `<UserPage>` read just a filtered list of posts from the cache. However, in order for `selectFromResult` to avoid unnecessary re-renders, we need to ensure that whatever data we extract is memoized correctly. To do this, we should create a new selector instance that the `<UserPage>` component can reuse every time it renders, so that the selector memoizes the result based on its inputs.
652652
653-
```tsx title="features/users/UsersPage.tsx"
653+
```tsx title="features/users/UserPage.tsx"
654654
import { Link, useParams } from 'react-router-dom'
655655
// highlight-start
656656
import { createSelector } from '@reduxjs/toolkit'

0 commit comments

Comments
 (0)