Skip to content

Commit

Permalink
docs: Fix typos in render-optimizations.md (#7246)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksp committed Apr 8, 2024
1 parent b9179d3 commit 565a241
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/framework/react/guides/render-optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ React Query uses a technique called "structural sharing" to ensure that as many
### referential identity

The top level object returned from `useQuery`, `useInfiniteQuery`, `useMutation` and the Array returned from `useQueries` is **not referentially stable**. It will be new a new reference on every render. However, the `data` properties returned from these hooks will be as stable as possible.
The top level object returned from `useQuery`, `useInfiniteQuery`, `useMutation` and the Array returned from `useQueries` is **not referentially stable**. It will be a new reference on every render. However, the `data` properties returned from these hooks will be as stable as possible.

## tracked properties

Expand Down Expand Up @@ -50,7 +50,7 @@ The `select` function will only re-run if:
- the `select` function itself changed referentially
- `data` changed

This means that an inlined `select` function, as shown above, will run on every render. To avoid this, you can wrap the `select` function in `useCallback`, or extract it so a stable function reference if it doesn't have any dependencies:
This means that an inlined `select` function, as shown above, will run on every render. To avoid this, you can wrap the `select` function in `useCallback`, or extract it to a stable function reference if it doesn't have any dependencies:

```js
// wrapped in useCallback
Expand Down

0 comments on commit 565a241

Please sign in to comment.