Skip to content

Required object argument in JSX.IntrinsicElements #1793

Answered by FrameMuse
FrameMuse asked this question in Q&A
Discussion options

You must be logged in to vote

It doesn't seem pretty but it works when changing

const Heading = props.heading as keyof JSX.IntrinsicElements

to

const Heading = props.heading as unknown as (props: React.HTMLAttributes<HTMLHeadingElement>) => JSX.Element

Although, It might be changed to

const Heading = props.heading as any

Replies: 3 comments 13 replies

Comment options

You must be logged in to vote
3 replies
@FrameMuse
Comment options

@FrameMuse
Comment options

@FrameMuse
Comment options

Comment options

You must be logged in to vote
9 replies
@FrameMuse
Comment options

@CodyJasonBennett
Comment options

@drcmda
Comment options

@FrameMuse
Comment options

@FrameMuse
Comment options

Comment options

You must be logged in to vote
1 reply
@drcmda
Comment options

Answer selected by FrameMuse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1792 on October 30, 2021 22:33.