Make route ID optional for @remix-run/testing createRemixStub #5122
kentcdodds
started this conversation in
Proposals
Replies: 1 comment
-
Would be great to see this fixed as useMatches is currently broken for me with @remix-run/testing if a route id isn't explicitly set as it tries to get a route handle here. I hit this very often since remix-validated-form uses useMatches internally. In remix-stubs I call convertRoutesToDataRoutes via createStaticHandler which automatically sets unique ids for each route and avoids this issue. So maybe there's an Option 3 where convertRoutesToDataRoutes is used to default all the route ids to their tree path. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Right now, if you don't pass a route.id, both the
routes
androuteModules
properties getundefined
keys that override one another for all the routes. TypeScript does't complain about this so we've got two options:I prefer option 1.
Here's the code I'm talking about:
Beta Was this translation helpful? Give feedback.
All reactions