๐—ฅ๐—ฒ๐—ฎ๐—ฐ๐˜ ๐Ÿญ๐Ÿต: ๐˜‚๐˜€๐—ฒ() ๐˜ƒ๐˜€ ๐˜‚๐˜€๐—ฒ๐—˜๐—ณ๐—ณ๐—ฒ๐—ฐ๐˜

I replaced useEffect with use() in React 19. I rewrote three parts of my code. I reverted one.

use() reads a promise in a component. The component waits for the value. You do not need useState. You do not need if loading checks.

This works for two things:

But it fails for polling.

I tried to use use() for a status check every 5 seconds. It did not work. I needed to cancel the call. I needed to trigger it again. My code became longer and had bugs.

I went back to useEffect.

Follow this rule:

use() is a tool for reading. It is not a tool for managing lifecycles.

New features are not magic. They are tools for specific jobs. Test one example before you refactor your whole app.

Source: https://dev.to/sensational5510/i-rewrote-3-useeffects-to-use-in-react-19-heres-the-one-i-shouldnt-have-9db