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
Add Typescript types for new app-router file conventions.
Non-Goals
No response
Background
Previously for the pages router we had type exports for getServerSideProps, NextPage, etc. For the new file conventions, having typescript types for the functions would be ideal.
Proposal
For the new app router, having types for layout.tsx, page.tsx, etc would be optimal as we would be able to know about using:
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
-
Goals
Add Typescript types for new app-router file conventions.
Non-Goals
No response
Background
Previously for the pages router we had type exports for
getServerSideProps
,NextPage
, etc. For the new file conventions, having typescript types for the functions would be ideal.Proposal
For the new app router, having types for
layout.tsx
,page.tsx
, etc would be optimal as we would be able to know about using:{ children: ReactNode; params?: Record<string, string> }
{ params?: Record<string, string>; searchParams?: Record<string, string> }
and so on. Having these in typescript types reduces the need to go to the documentation.
Beta Was this translation helpful? Give feedback.
All reactions