Next.js Discord

Discord Forum

Component does not reset

Unanswered
Carpenter ant posted this in #help-forum
Open in Discord
Carpenter antOP
Help please, I have a page (app/ChannelsPage)
const ChannelsPage = ({ params }: { params: { channelsSlug: string[] } }) => { return <ChannelsComponent channelsSlug={params.channelsSlug} />; };

And there is a component ChannelsComponent, how to make it so that the component does not reset its state when changing channelsSlug

2 Replies

or put the data in a top-level context, preferably managed by a state management like RQ because, the state will always be lost if you do hard navigation