You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[UNSTABLE] Add `unstable_pattern` to the parameters for client side `unstable_onError`, refactor how it's called by `RouterProvider` to avoid potential strict mode issues
Add new `unstable_useTransitions` flag to routers to give users control over the usage of [`React.startTransition`](https://react.dev/reference/react/startTransition) and [`React.useOptimistic`](https://react.dev/reference/react/useOptimistic).
- Router state updates are wrapped in `React.startTransition`
11
+
- ⚠️ This can lead to buggy behaviors if you are wrapping your own navigations/fetchers in `React.startTransition`
12
+
- You should set the flag to `true` if you run into this scenario to get the enhanced `useOptimistic` behavior (requires React 19)
13
+
- When set to `true`
14
+
- Router state updates remain wrapped in `React.startTransition` (as they are without the flag)
15
+
-`Link`/`Form` navigations will be wrapped in `React.startTransition`
16
+
- A subset of router state info will be surfaced to the UI _during_ navigations via `React.useOptimistic` (i.e., `useNavigation()`, `useFetchers()`, etc.)
17
+
- ⚠️ This is a React 19 API so you must also be React 19 to opt into this flag for Framework/Data Mode
18
+
- When set to `false`
19
+
- The router will not leverage `React.startTransition` or `React.useOptimistic` on any navigations or state changes
20
+
- Declarative Mode
21
+
-`<BrowserRouter unstable_useTransitions>`
22
+
- When left unset
23
+
- Router state updates are wrapped in `React.startTransition`
24
+
- When set to `true`
25
+
- Router state updates remain wrapped in `React.startTransition` (as they are without the flag)
26
+
-`Link`/`Form` navigations will be wrapped in `React.startTransition`
27
+
- When set to `false`
28
+
- the router will not leverage `React.startTransition` on any navigations or state changes
Fix the promise returned from `useNavigate` in Framework/Data Mode so that it properly tracks the duration of `popstate` navigations (i.e., `navigate(-1)`)
0 commit comments