inertia icon indicating copy to clipboard operation
inertia copied to clipboard

Add children to InertiaHead type

Open Francismori7 opened this issue 2 years ago • 2 comments

This makes sure you can use the following while using TypeScript:

    <Head>
      <title>
        {title ? `${title} - Inertia E-Commerce` : 'Inertia E-Commerce'}
      </title>

      <meta
        name="description"
        head-key="description"
        content="This is an example of a meta description. This will often show up in search results."
      />

      {children}
    </Head>

Otherwise, there would be a type error saying that the Head component cannot have any children.

Francismori7 avatar Jul 13 '22 18:07 Francismori7

@reinink @claudiodekker I had the exact same issue just now. Is there anything that needs to be done in order to get this PR merged? 👼🏻

johanvanhelden avatar Aug 12 '22 12:08 johanvanhelden

I'm having the same issue in my app. Instead of any[] would it make more sense to set the type to React.ReactNode?

type InertiaHeadProps = {
    title?: string
    children?: React.ReactNode
}

benbjurstrom avatar Aug 13 '22 00:08 benbjurstrom

Hey! Thanks so much for your interest in Inertia.js and for submitting this contribution.

In an attempt to get on top of the issues and pull requests on this project I am going through all the older issues and PRs and closing them, as there's a decent chance that they have since been resolved or are simply not relevant any longer. My hope is that with a "clean slate" me and the other project maintainers will be able to better keep on top of issues and PRs moving forward.

Of course there's a chance that this PR is still relevant, and if that's the case feel free to re-submit it. If it's a new feature and not a bug fix maybe respond here first to make sure that it's something we want to include in the library.

Really not trying to be dismissive here, I just need to find a way to get this project back into a state that I am able to maintain it. Hope that makes sense! ❤️

reinink avatar Jul 28 '23 02:07 reinink