DEV Community

Discussion on: Notes on TypeScript: Inferring React PropTypes

 
busypeoples profile image
A. Sharif

This is interesting. Can you take a look at the simplified example:
codesandbox.io/s/fancy-bird-vqd9x

If you remove defaultProps TypeScript will complain.

Thread Thread
 
busypeoples profile image
A. Sharif

I think the problem in this specific case is tied to using forwardRef. Will try to find out in more detail , but I think forwardRef drops any default props.