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
The react-router typegen command recognises you are using the route setup for everything instead of index() and does not create duplicate entries in the +register.ts types file.
OR
Documentation on the react-router website warns consumers of the requirement to at least have a base index() route
The react-router typegen command throws a descriptive error to point the user in the right direction
Option 2 may be easier to code for, since we can just check if there are NO routes with an index: true property.
Actual Behavior
react-router typegen command creates two "/": {}; entries in the .react-router/types/+register.ts file
Subsequent type checks fail with:
.react-router/types/+register.ts:10:3 - error TS2300: Duplicate identifier '/'.
10 "/": {};
~~~
.react-router/types/+register.ts:14:3 - error TS2300: Duplicate identifier '/'.
14 "/": {};
~~~
Found 2 errors in the same file, starting at: .react-router/types/+register.ts:10
The text was updated successfully, but these errors were encountered:
I'm using React Router as a...
framework
Reproduction
https://stackblitz.com/edit/github-ckdgdgys
routes.ts
file, withroute('/', 'path/to/index.tsx')
instead ofindex('path/to/index.tsx')
routenpm run typecheck
.react-router/types/+register.ts
has duplicate"/": {};
entrySystem Info
Used Package Manager
npm
Expected Behavior
I see two routes of expected behaviour:
react-router typegen
command recognises you are using theroute
setup for everything instead ofindex()
and does not create duplicate entries in the+register.ts
types file.OR
index()
routereact-router typegen
command throws a descriptive error to point the user in the right directionOption 2 may be easier to code for, since we can just check if there are NO routes with an
index: true
property.Actual Behavior
react-router typegen
command creates two"/": {};
entries in the.react-router/types/+register.ts
fileThe text was updated successfully, but these errors were encountered: