-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type error with children in Head component #1437
Comments
Just ran into this problem too... There is a bunch of other PRs and Issues about this and still nothing... ;/ |
Hey! I'm unable to replicate this in the React TypeScript playground at https://github.com/inertiajs/inertia/tree/master/playgrounds/react Is there perhaps a I've merged #1433, but I don't think that would have changed anything with this. |
Hey, thanks for checking on this. This is the
v |
@jessarcher So... You need to install the @types/react and i think the @types/react-dom too (!?) packages... Thats when the problems show up... I'm getting both problems on the playgrounds/react project... (PS: I wasn't able to run the code inside the monorepo, it wasn't finding some of the dependencies, so i extracted the react project and installed all dependencies to test...) #1325 or #1315 should fix the Head bug!? I dunno why #1315 was closed, tbh... |
I created PR #1448 to explicitly declare children in type definition. |
Thank you! I've merged #1448 |
Version:
@inertiajs/react
version: 1.0.0Describe the problem:
According to documentation you should be able to have children in the Inertia's
Head
component. This is the only way to include a meta tag in the head.However, this code results in the following error:
Type '{ children: Element[]; }' has no properties in common with type 'IntrinsicAttributes & InertiaHeadProps'.
Because the
Head
component only acceptstitle
as props, there is no way to add meta to the head without a type error.Steps to reproduce:
PR
I believe this issue is in addition to the PR #1433
Does the
InertiaHead
type need to be wrapped inPropsWithChildren
generic?The text was updated successfully, but these errors were encountered: