mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
* fix(web/router): defer popstate dispatch to microtask navigate() previously dispatched a synchronous popstate event after mutating window.history, which caused React 18 to emit: Cannot update a component (Router) 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 This happens whenever a caller invokes navigate() from inside a useState updater (e.g. App.tsx:479 routing first-run users through the onboarding panel from inside the setConfig() update). The synchronous popstate dispatch reaches useRoute() subscribers which then call setRoute() while the parent component is still rendering. Defer the popstate dispatch to a microtask. The window.history call itself stays synchronous so the URL bar updates immediately; only subscriber updates are pushed past the current render commit, which removes the warning without changing observable behaviour for any existing caller. * fix(web/router): cover deferred navigation timing --------- Co-authored-by: Visionboost <contact@visionboost.fr> Co-authored-by: Siri-Ray <2667192167@qq.com> |
||
|---|---|---|
| .. | ||
| analytics | ||
| artifacts | ||
| components | ||
| edit-mode | ||
| helpers | ||
| hooks | ||
| i18n | ||
| lib | ||
| observability | ||
| providers | ||
| runtime | ||
| state | ||
| styles | ||
| utils | ||
| analytics-app-version.test.tsx | ||
| analytics-configure-globals.test.ts | ||
| analytics-identity.test.ts | ||
| analytics-scrub.test.ts | ||
| api-attachment-context.test.ts | ||
| App.test.ts | ||
| comments.test.ts | ||
| host-boundary.test.ts | ||
| quickSwitcherRecents.test.ts | ||
| router-marketplace.test.ts | ||
| router.navigate.test.tsx | ||
| router.test.ts | ||
| sidecar-proxy.test.ts | ||