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
Seems to work fine in the UI, but Typescript isn't happy with the type of the children I'm passing to Menu- specifically, it seems to think there shouldn't be children, of any kind:
Type '{ children: Element; as: string; className: string; }' is not assignable to type 'Omit<never, PropsWeControl>'.
Property 'children' is incompatible with index signature.
Type 'Element' is not assignable to type 'never'.ts(2322)
I'm getting similar with Disclosure, where I get this error:
Type '{ children: ({ open }: { open: boolean; }) => Element; as: string; className: string; }' is not assignable to type 'Omit<never, "className" | "children" | "as" | "refName">'.
Property 'children' is incompatible with index signature.
Type '({ open }: { open: boolean; }) => JSX.Element' is not assignable to type 'never'.ts(2322)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
So, I've got the following component:
Seems to work fine in the UI, but Typescript isn't happy with the type of the
children
I'm passing toMenu
- specifically, it seems to think there shouldn't be children, of any kind:I'm getting similar with
Disclosure
, where I get this error:Both are taken as examples from this NavBar component from TailwindUI.com.
Beta Was this translation helpful? Give feedback.
All reactions