

This was a PC project where I clicked a search suggestion in the head, getting an error as above with the page’s navigation.
“Cannot update a component (NavBar) while rendering a different component (App). To locate the bad setState() call inside App, follow the stack trace as described in https://react.dev/link/setstate-in-render“
The search suggestion data are stored in redux imported in the component, App. NavBar gets them from redux as below:


The relevant dependencies are:
{ "next": "15.3.4", "react": "^19.0.0", "@reduxjs/toolkit": "^2.8.2", "next-redux-wrapper": "^8.1.0", "react-redux": "^9.2.0"}How can I solve it? Thanks in advance!