1

Exporting Props from a React.Component is easy enough, but how do you properly extract the types the Component is actually using, once defaultProps are taken into account? I imagine you could omit keys from Props and then merge with a Partial of defaultProps, but are there any built-in ways of this? Flow accomplishes this with React.ElementConfig

0

1 Answer 1

2

You are looking for:

JSX.LibraryManagedAttributes<typeof MyComponent, MyComponent["props"]>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.