Replies: 1 comment 1 reply
-
Oh, I just saw this tool linked in the docs! https://next-code-elimination.now.sh Think that answers my question :) |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hey!
I generally like type inference more than pre-defined types and wondering if it's generally safe to export types from API routes and use them in my components?
I've made an example here: https://github.com/KATT/nextjs-with-typescript-and-type-inference
In this example, I've created an API-route from which I'm inferring types into my pages & components. Is it safe to do this? Feels bad to import
api/
-stuff into React-components.GetUsersResponse
inapi/users/index.tsx
pages/users/index.tsx
List
/ListItem
Beta Was this translation helpful? Give feedback.
All reactions