Next.js Discord

Discord Forum

Anti-pattern or not? Using state managers with App directory in Next.js 14.

Unanswered
nyxz posted this in #help-forum
Open in Discord
Coming from plain React world I'm used to having a state manager in the application (like RTK https://redux-toolkit.js.org/ for instance).
With the server actions and the way we load data from external sources and manages state invalidation in the pages it feels that I should be passing data down from the root component to sub-components in the tree because I don't want to have multiple state managers. Would you agree that having RTK on the side in a app directory page would be considered an anti-pattern?

3 Replies

Oh, I didn't know that react-query can do that, thanks! The approach with HydrationBoundary looks pretty neat.