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
Is your feature request related to a problem? Please describe.
In newly generated projects by ct3a the exported metadata object in the layout.tsx has no type constraint. This makes it harder to find the appropriate configuration keys in the Next.js documentation. Although this is trivial to find and solve, I think this should be included in the templates nevertheless.
Describe the solution you'd like to see
Constraining the exported object to the Metadata type from the next solves this issue. This change would need to be added in the following places:
Just letting the users add the type on their own and not implementing this change could be an alternative, but I don't see any reason why this shouldn't be included in the first place.
Additional information
I'd be happy to implement this change and submit a PR 🙌🏻
The text was updated successfully, but these errors were encountered:
Apparently this type automatically added to the metadata object in i.e. an IDE when using the TypeScript Plugin provided by Next.js. Nevertheless, I still think the explicit way is better because it works even when not switching to the included language server and can help new users to find the origin of the type much easier.
Is your feature request related to a problem? Please describe.
In newly generated projects by ct3a the exported metadata object in the
layout.tsx
has no type constraint. This makes it harder to find the appropriate configuration keys in the Next.js documentation. Although this is trivial to find and solve, I think this should be included in the templates nevertheless.Describe the solution you'd like to see
Constraining the exported object to the
Metadata
type from thenext
solves this issue. This change would need to be added in the following places:cli/template/extras/src/app/layout/base.tsx
cli/template/extras/src/app/layout/with-trpc-tw.tsx
cli/template/extras/src/app/layout/with-trpc.tsx
cli/template/extras/src/app/layout/with-tw.tsx
Describe alternate solutions
Just letting the users add the type on their own and not implementing this change could be an alternative, but I don't see any reason why this shouldn't be included in the first place.
Additional information
I'd be happy to implement this change and submit a PR 🙌🏻
The text was updated successfully, but these errors were encountered: