Skip to content

Commit

Permalink
feat: add support for starttransition
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Nov 24, 2023
1 parent d1a2163 commit c2b6760
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/router/src/@types/index.ts
Expand Up @@ -4,6 +4,7 @@ export interface HanaOptions {
}

export interface RouterOptions {
usePageTransition?: boolean;
mode: 'history' | 'hash';
root: string;
routes: {
Expand Down
6 changes: 5 additions & 1 deletion packages/router/src/router/core.tsx
Expand Up @@ -5,9 +5,10 @@ import {
createHashRouter,
} from 'react-router-dom';

import { RouterOptions } from '../@types';
import type { RouterOptions } from '../@types';

export function createRouter({
usePageTransition = false,
mode = 'history',
routes: appRoutes,
root,
Expand Down Expand Up @@ -115,5 +116,8 @@ export function createRouter({
return createElement(RouterProvider, {
router:
mode === 'hash' ? createHashRouter(routes) : createBrowserRouter(routes),
future: {
v7_startTransition: usePageTransition,
},
});
}
2 changes: 1 addition & 1 deletion packages/router/src/router/index.ts
Expand Up @@ -4,7 +4,7 @@ export {
useNavigate,
useParams,
useSearchParams,
useBeforeUnload,
} from 'react-router-dom';

export * from './core';
export * from './navigation';
1 change: 0 additions & 1 deletion packages/router/src/router/navigation.tsx

This file was deleted.

0 comments on commit c2b6760

Please sign in to comment.