-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
When I add a new review, I've got this one on route change:
Cannot update a component (AverageRating) while rendering a different component (AverageRating). To locate the bad setState() call inside AverageRating, follow the stack trace as described in https://react.dev/link/setstate-in-render
src\app\products[id]\components\AverageRating.tsx (16:11) @ dispatch
14 | const initialized = useRef(false);
15 | if (!initialized.current) {
> 16 | store.dispatch(setReviews(initialReviews));
| ^
17 | initialized.current = true;
18 | }
19 | const reviews = useReviews();
I've cloed your repo.
Metadata
Metadata
Assignees
Labels
No labels