Synchronize with an external system
#useEffect runs after commit in the client. Dependencies must include reactive values used by the effect; cleanup runs before a changed setup and on unmount.
Fragment
Before you use this
React TypeScript/JSX project; use body fragments in a component and supply app-owned names.
import { useEffect } from "react";Development Strict Mode can run an extra setup/cleanup cycle.
To read the latest callback without re-subscribing, wrap it with useEffectEvent (React 19.2+).