File tree Expand file tree Collapse file tree 3 files changed +12
-14
lines changed
examples/46_navigation_api Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 1616 },
1717 "devDependencies" : {
1818 "@tailwindcss/vite" : " ^4.1.18" ,
19- "@types/dom-navigation" : " ^1.0.6" ,
2019 "@types/react" : " ^19.2.7" ,
2120 "@types/react-dom" : " ^19.2.3" ,
21+ "@types/web" : " ^0.0.310" ,
2222 "@vitejs/plugin-react" : " ^5.1.0" ,
2323 "babel-plugin-react-compiler" : " ^1.0.0" ,
2424 "tailwindcss" : " ^4.1.18" ,
Original file line number Diff line number Diff line change @@ -905,7 +905,7 @@ const InnerRouter = ({
905905
906906 // https://github.com/facebook/react/blob/main/fixtures/view-transition/src/components/App.js
907907 useEffect ( ( ) => {
908- const callback = ( event : NavigateEvent ) => {
908+ const callback = ( ( event : NavigateEvent ) => {
909909 if (
910910 ! event . canIntercept ||
911911 // If this is just a hashChange,
@@ -924,10 +924,8 @@ const InnerRouter = ({
924924 const route = parseRoute ( url ) ;
925925 console . log ( event ) ;
926926 const navigationType = event . navigationType ;
927- // @ts -expect-error not supported yet
928- const previousIndex = window . navigation . currentEntry . index ;
927+ const previousIndex = window . navigation . currentEntry ! . index ;
929928 event . intercept ( {
930- // @ts -expect-error not supported yet
931929 async precommitHandler ( ) {
932930 startTransition ( async ( ) => {
933931 // addTransitionType('navigation-' + navigationType);
@@ -958,7 +956,7 @@ const InnerRouter = ({
958956 } ,
959957 scroll : 'after-transition' ,
960958 } ) ;
961- } ;
959+ } ) as EventListener ;
962960 window . navigation . addEventListener ( 'navigate' , callback ) ;
963961 return ( ) => {
964962 window . navigation . removeEventListener ( 'navigate' , callback ) ;
You can’t perform that action at this time.
0 commit comments