Skip to content

Commit

Permalink
fix(react-template): fix warning fron react-router-dom
Browse files Browse the repository at this point in the history
  • Loading branch information
pplancq committed Nov 13, 2024
1 parent e613869 commit 6e71da3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Footer } from '../Footer';
describe('Footer Component', () => {
it('should render the Footer component correctly', () => {
const { container } = render(
<Router>
<Router future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
<Footer />
</Router>,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Header } from '../Header';
describe('Header Component', () => {
it('should render the Header component correctly', () => {
const { container } = render(
<Router>
<Router future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
<Header />
</Router>,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Demo } from '../Demo';
describe('Demo Component', () => {
it('should render the Demo component correctly', () => {
const { container } = render(
<Router>
<Router future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
<Demo />
</Router>,
);
Expand Down
10 changes: 9 additions & 1 deletion packages/react-template/src/routing/routerFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,13 @@ interface CreateRouterProps {
}

export const createRouter = ({ basename }: CreateRouterProps = {}) => {
return createBrowserRouter(routeObject, { basename });
return createBrowserRouter(routeObject, {
basename,
future: {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
v7_startTransition: true,
v7_relativeSplatPath: true,
},
});
};

0 comments on commit 6e71da3

Please sign in to comment.