You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, recently I updated react-router from v6.3 to 6.10 and stacked with type error when I use useRouter hook. I noticed type RouteObject is changed, it's now RouteObject = IndexRouteObject | NonIndexRouteObject. Both types, IndexRouteObject and NonIndexRouteObject, contains common property index, but in type IndexRouteObject this property is required. And there is a problem with TypeScript, when I need to customize type RouteObject, I get the error: Type 'boolean' is not assignable to type 'false'. I thought, maybe you can change type RouteObject? Extract property index from both types IndexRouteObject and NonIndexRouteObject, after that to determine type RouteObject something like that RouteObject = (IndexRouteObject | NonIndexRouteObject) & {index?: boolean}? Thanks
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, recently I updated react-router from v6.3 to 6.10 and stacked with type error when I use useRouter hook. I noticed type
RouteObject
is changed, it's nowRouteObject = IndexRouteObject | NonIndexRouteObject
. Both types,IndexRouteObject
andNonIndexRouteObject
, contains common property index, but in typeIndexRouteObject
this property is required. And there is a problem with TypeScript, when I need to customize typeRouteObject
, I get the error: Type 'boolean' is not assignable to type 'false'. I thought, maybe you can change typeRouteObject
? Extract property index from both typesIndexRouteObject
andNonIndexRouteObject
, after that to determine typeRouteObject
something like thatRouteObject = (IndexRouteObject | NonIndexRouteObject) & {index?: boolean}
? ThanksBeta Was this translation helpful? Give feedback.
All reactions