types-plugin: enahnce type checking on interface params (#71059)
### What
This PR enhances the next-types-plugin to generate more compatible types for cases like typed `params` with a `interface` type `page.tsx` or `layout.tsx`
#### Issue
Previously users might break with type check
```tsx
interface Params { slug: string } // this will fail
export default async function Page({ params }: { params: Promise<Params>})
```
To workaround users have to turn it into a more general `Record` like type
```diff
interface Params {
slug: string
+ [key: string]: string
}
```
This PR helps get rid of the above workaround. You just need to type it properly with Promise for `params` then it's all done.
Showing
Please
register
or
sign in
to comment