Closed MarchewkaMatthew closed 1 year ago
That example has a route [...missing].tsx
which is a catch-all route on the top level - meaning all routes are "registered" from a types perspective.
This is an unfortunately side-effect while we are still exploring options to best represent 404 and/or error pages.
Which package manager are you using? (Yarn is recommended)
npm
Summary
Hi,
Thank you for maintaining this module. I have a question regarding the type-safety of the
<Link />
component usingexpo-router
v2 and expo SDK 49. I've created a new project using thenpx create-expo-app@latest --template tabs@sdk-49
command. After the first run, I wanted to try typed hrefs, unfortunately, there is no TS error when I use the wrong path (type hints work well when I type, so TypeScript is able to read the/.expo/types/router.d.ts
file). Is there any way to make it more secure and allow only registered routes?Here are the related packages versions:
Minimal reproducible example
npx create-expo-app@latest --template tabs@sdk-49
npm start
to generate/.expo/types/router.d.ts
file/app/(tabs)/_layout.tsx
and change the link href to/anything