How I've fetched in React over 10 years: 2014: Fetch in componentDidMount...
How I've fetched in React over 10 years:
2014: Fetch in componentDidMount
2019: Fetch in useEffect
2020: Custom useFetch hook
2021: React query
2022: React query with useErrorBoundary
2023: React query with useSuspenseQuery
2024: React Server Components
2025: Sync-engine
I still enjoy using Tanstack Query and RSC. But a sync-engine is the most elegant remote state approach I've found so far. Sync-engines abstract away the network and live queries automatically keep the UI fresh.
Examples: @convex_dev, @zero__ms, @ElectricSQL
@convex_dev @zero__ms @ElectricSQL I'm also eager to use @tan_stack DB more since it's easy to adopt with an existing REST/GraphQL backend, but I haven't used it enough to recommend it yet, and it's not 1.0 yet.
(To be fair, some sync engines like Zero aren't 1.0 yet either.)