Easy Redux & NextJS 13 AppRouter hydratation

February 2, 2024

Medium
Hydration — DALL-E 2024/02/02

I’m I the only one who struggle with NextJS 13 App Router hydratation?

The Solution

Fetch data along server side render, and load it in redux state at first render.

pnpm add use-hydrate
yarn add use-hydrate
npm i use-hydrate

GitHub - samuelint/use-hydrate: Nextjs 13 App Router easy redux hydratation

Usage example

Here’s the code, (if you do not want to add the lib).