diff --git a/packages/ts/file-router/src/runtime/RouterConfigurationBuilder.ts b/packages/ts/file-router/src/runtime/RouterConfigurationBuilder.ts index d62a762560..6215ff7e82 100644 --- a/packages/ts/file-router/src/runtime/RouterConfigurationBuilder.ts +++ b/packages/ts/file-router/src/runtime/RouterConfigurationBuilder.ts @@ -322,7 +322,22 @@ export class RouterConfigurationBuilder { return { routes, - router: createBrowserRouter([...routes], { basename: new URL(document.baseURI).pathname, ...options }), + router: createBrowserRouter([...routes], { + basename: new URL(document.baseURI).pathname, + future: { + // eslint-disable-next-line camelcase + v7_fetcherPersist: true, + // eslint-disable-next-line camelcase + v7_normalizeFormMethod: true, + // eslint-disable-next-line camelcase + v7_partialHydration: true, + // eslint-disable-next-line camelcase + v7_relativeSplatPath: true, + // eslint-disable-next-line camelcase + v7_skipActionErrorRevalidation: true, + }, + ...options, + }), }; } } diff --git a/packages/ts/file-router/test/runtime/RouterConfigurationBuilder.spec.tsx b/packages/ts/file-router/test/runtime/RouterConfigurationBuilder.spec.tsx index 1c4d7eff33..511b5cb80a 100644 --- a/packages/ts/file-router/test/runtime/RouterConfigurationBuilder.spec.tsx +++ b/packages/ts/file-router/test/runtime/RouterConfigurationBuilder.spec.tsx @@ -528,7 +528,21 @@ describe('RouterBuilder', () => { const { routes, router } = builder.build(); expect(router).to.equal(browserRouter); - expect(createBrowserRouter).to.have.been.calledWith(routes, { basename: '/foo' }); + expect(createBrowserRouter).to.have.been.calledWith(routes, { + basename: '/foo', + future: { + // eslint-disable-next-line camelcase + v7_fetcherPersist: true, + // eslint-disable-next-line camelcase + v7_normalizeFormMethod: true, + // eslint-disable-next-line camelcase + v7_partialHydration: true, + // eslint-disable-next-line camelcase + v7_relativeSplatPath: true, + // eslint-disable-next-line camelcase + v7_skipActionErrorRevalidation: true, + }, + }); reset(); }); });