@@ -618,7 +618,13 @@ export default function Routes() {
618618 < Route path = { ONBOARDING_ROUTE } component = { OnboardingFlow } />
619619 { /** @ts -expect-error TODO: Replace `component` prop with `element` once `react-router` is upgraded to v6 */ }
620620 < Route path = { LOCK_ROUTE } component = { Lock } exact />
621- < Route path = { UNLOCK_ROUTE } exact >
621+ < Route
622+ path = { UNLOCK_ROUTE }
623+ // v5 Route supports exact with render props, but TS types don't recognize it
624+ // Using spread operator with type assertion to bypass incorrect type definitions
625+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
626+ { ...( { exact : true } as any ) }
627+ >
622628 { ( props : RouteComponentProps ) => {
623629 const { history : v5History , location : v5Location } = props ;
624630 const navigate = createV5CompatNavigate ( v5History ) ;
@@ -666,15 +672,12 @@ export default function Routes() {
666672 keyringId ?: string ;
667673 } > ;
668674 return (
669- < Authenticated
670- path = { `${ REVEAL_SEED_ROUTE } /:keyringId?` }
671- component = { ( ) => (
672- < RevealSeedConfirmationComponent
673- navigate = { navigate }
674- keyringId = { match . params . keyringId }
675- />
676- ) }
677- />
675+ < AuthenticatedV5Compat >
676+ < RevealSeedConfirmationComponent
677+ navigate = { navigate }
678+ keyringId = { match . params . keyringId }
679+ />
680+ </ AuthenticatedV5Compat >
678681 ) ;
679682 } }
680683 </ Route >
@@ -870,15 +873,12 @@ export default function Routes() {
870873 params : { chainId : string ; protocolId : string } ;
871874 } > ;
872875 return (
873- < Authenticated
874- path = { `${ DEFI_ROUTE } /:chainId/:protocolId` }
875- component = { ( ) => (
876- < DeFiPageComponent
877- navigate = { navigate }
878- params = { match . params }
879- />
880- ) }
881- />
876+ < AuthenticatedV5Compat >
877+ < DeFiPageComponent
878+ navigate = { navigate }
879+ params = { match . params }
880+ />
881+ </ AuthenticatedV5Compat >
882882 ) ;
883883 } }
884884 </ Route >
@@ -1121,7 +1121,12 @@ export default function Routes() {
11211121 { renderRoutes ( ) }
11221122 </ Box >
11231123 { isUnlocked ? < Alerts history = { history } /> : null }
1124- < ToastMaster location = { location } />
1124+ { React . createElement (
1125+ ToastMaster as React . ComponentType < {
1126+ location : RouteComponentProps [ 'location' ] ;
1127+ } > ,
1128+ { location } ,
1129+ ) }
11251130 </ div >
11261131 ) ;
11271132}
0 commit comments