Skip to content

Commit

Permalink
Remove future.v7_startTransition flag (#11696)
Browse files Browse the repository at this point in the history
* Remove future.v7_startTransition flag

* Remove from docs
  • Loading branch information
brophdawg11 authored Jun 25, 2024
1 parent f754173 commit 714a2c5
Show file tree
Hide file tree
Showing 14 changed files with 262 additions and 706 deletions.
6 changes: 6 additions & 0 deletions .changeset/early-beds-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"react-router-dom": major
"react-router": major
---

Remove `future.v7_startTransition` flag
8 changes: 1 addition & 7 deletions examples/view-transitions/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,7 @@ function NavImage({ src, idx }: { src: string; idx: number }) {
const rootElement = document.getElementById("root") as HTMLElement;
ReactDOMClient.createRoot(rootElement).render(
<React.StrictMode>
<RouterProvider
router={router}
future={{
// Wrap all state updates in React.startTransition()
v7_startTransition: true,
}}
/>
<RouterProvider router={router} />
</React.StrictMode>
);

Expand Down
1 change: 0 additions & 1 deletion packages/react-router-dom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export type {
unstable_DataStrategyMatch,
ErrorResponse,
Fetcher,
FutureConfig,
Hash,
IndexRouteObject,
IndexRouteProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe("Handles concurrent mode features during navigations", () => {
getComponents();

let { container } = render(
<MemoryRouter future={{ v7_startTransition: true }}>
<MemoryRouter>
<Routes>
<Route path="/" element={<Home />} />
<Route
Expand Down Expand Up @@ -149,10 +149,7 @@ describe("Handles concurrent mode features during navigations", () => {
getComponents();

let { container } = render(
<BrowserRouter
window={getWindowImpl("/", false)}
future={{ v7_startTransition: true }}
>
<BrowserRouter window={getWindowImpl("/", false)}>
<Routes>
<Route path="/" element={<Home />} />
<Route
Expand Down Expand Up @@ -184,10 +181,7 @@ describe("Handles concurrent mode features during navigations", () => {
getComponents();

let { container } = render(
<HashRouter
window={getWindowImpl("/", true)}
future={{ v7_startTransition: true }}
>
<HashRouter window={getWindowImpl("/", true)}>
<Routes>
<Route path="/" element={<Home />} />
<Route
Expand Down Expand Up @@ -241,9 +235,7 @@ describe("Handles concurrent mode features during navigations", () => {
</>
)
);
let { container } = render(
<RouterProvider router={router} future={{ v7_startTransition: true }} />
);
let { container } = render(<RouterProvider router={router} />);

await assertNavigation(container, resolve, resolveLazy);
});
Expand Down Expand Up @@ -296,7 +288,7 @@ describe("Handles concurrent mode features during navigations", () => {
getComponents();

let { container } = render(
<MemoryRouter future={{ v7_startTransition: true }}>
<MemoryRouter>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/about" element={<About />} />
Expand All @@ -314,10 +306,7 @@ describe("Handles concurrent mode features during navigations", () => {
getComponents();

let { container } = render(
<BrowserRouter
window-={getWindowImpl("/", true)}
future={{ v7_startTransition: true }}
>
<BrowserRouter window-={getWindowImpl("/", true)}>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/about" element={<About />} />
Expand All @@ -335,10 +324,7 @@ describe("Handles concurrent mode features during navigations", () => {
getComponents();

let { container } = render(
<HashRouter
window-={getWindowImpl("/", true)}
future={{ v7_startTransition: true }}
>
<HashRouter window-={getWindowImpl("/", true)}>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/about" element={<About />} />
Expand All @@ -364,9 +350,7 @@ describe("Handles concurrent mode features during navigations", () => {
</>
)
);
let { container } = render(
<RouterProvider router={router} future={{ v7_startTransition: true }} />
);
let { container } = render(<RouterProvider router={router} />);

await assertNavigation(container, resolve, resolveLazy);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ describe("flushSync", () => {
window: getWindowImpl("/"),
}
);
render(
<RouterProvider router={router} future={{ v7_startTransition: true }} />
);
render(<RouterProvider router={router} />);

// This isn't the best way to test this but it seems that startTransition is
// performing sync updates in the test/JSDOM/whatever environment which is
Expand Down Expand Up @@ -127,9 +125,7 @@ describe("flushSync", () => {
window: getWindowImpl("/"),
}
);
render(
<RouterProvider router={router} future={{ v7_startTransition: true }} />
);
render(<RouterProvider router={router} />);

// This isn't the best way to test this but it seems that startTransition is
// performing sync updates in the test/JSDOM/whatever environment which is
Expand Down Expand Up @@ -191,9 +187,7 @@ describe("flushSync", () => {
window: getWindowImpl("/"),
}
);
render(
<RouterProvider router={router} future={{ v7_startTransition: true }} />
);
render(<RouterProvider router={router} />);

// This isn't the best way to test this but it seems that startTransition is
// performing sync updates in the test/JSDOM/whatever environment which is
Expand Down Expand Up @@ -256,9 +250,7 @@ describe("flushSync", () => {
window: getWindowImpl("/"),
}
);
render(
<RouterProvider router={router} future={{ v7_startTransition: true }} />
);
render(<RouterProvider router={router} />);

// This isn't the best way to test this but it seems that startTransition is
// performing sync updates in the test/JSDOM/whatever environment which is
Expand Down
Loading

0 comments on commit 714a2c5

Please # to comment.