Skip to content

Commit 8f434be

Browse files
committed
docs: minor fixes
1 parent 0db1a8f commit 8f434be

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/plugins/eslint-plugin-react-hooks-extra/src/rules/no-direct-set-state-in-use-layout-effect.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ react-hooks-extra/no-direct-set-state-in-use-layout-effect
1818

1919
`🧪`
2020

21-
**Presets**
22-
23-
- `recommended`
24-
- `recommended-typescript`
25-
- `recommended-type-checked`
26-
2721
## Description
2822

2923
Disallow **direct** calls to the [`set` function](https://react.dev/reference/react/useState#setstate) of `useState` in `useLayoutEffect`.
@@ -147,7 +141,11 @@ export default function RemoteContent() {
147141
}
148142
```
149143

150-
The following examples are derived from the [React documentation](https://react.dev/learn/you-might-not-need-an-effect):
144+
<Callout title="TIP">
145+
If you need to fetch remote data within the component, consider using libraries like [TanStack Query](https://tanstack.com/query/v3/) or [SWR](https://swr.vercel.app/). They handle caching, re-fetching, and state management for you, making your code cleaner and more efficient.
146+
</Callout>
147+
148+
The following examples are derived from the [React Docs: You Might Not Need an Effect](https://react.dev/learn/you-might-not-need-an-effect):
151149

152150
### Failing
153151

0 commit comments

Comments
 (0)