TS-newbie struggles with TS via NextJS Layout
I am creating a simple layout file that looks like this:
The
Nav
is structured to optionally taking a string prop to set as a title for for Head:
The problem is that in the layout
on the Nav
element:
Type '{ title: string | undefined; }' is not assignable to type 'string'.
I understand and see what the problem is, but I don't know how to do things differently to make TS happy.
In case I'm not being clear about what I want to end up with: I want a reusable Layout
to wrap pages around. This Layout
may or may not at times be given a title
prop that sets the title for the tab2 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I see. Thank you! 🙂