Skip to content

How to use forwardRef component with MDXProvider and keep TypeScript happy? #2086

Answered by wooorm
igordanchenko asked this question in Q&A
Discussion options

You must be logged in to vote

To get types to work, it is important to use the same types on your end as are allowed in the MDX types.
The MDX types are here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/mdx/types.d.ts#L22, which expands to JSX.IntrinsicElements['a'].

Replies: 2 comments 15 replies

Comment options

You must be logged in to vote
11 replies
@remcohaszing
Comment options

@igordanchenko
Comment options

@igordanchenko
Comment options

@remcohaszing
Comment options

@wooorm
Comment options

Answer selected by igordanchenko
Comment options

You must be logged in to vote
4 replies
@igordanchenko
Comment options

@schardev
Comment options

@remcohaszing
Comment options

@remcohaszing
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
☂️ area/types This affects typings
4 participants