I'm new to Typescript and after reading some related articles it seems that by using Typescript in React, propTypes definitions are no longer needed.
But by checking some of the most populars React Component Libraries projects
like Material-IU:
...it seems some big projects are using both. So, i'm a bit confused about this. And i don't really get the purpose of these *.d.ts files
Why are they using both? What is the purpose of the *.d.ts files? How does this fit in a react development workflow?
My actual idea about this this is that:
- *.d.ts should contain the types for the component's props
- typescript will launch compilation errors if some prop is receiving a wrong type of data
- the React component definition can avoid defining the propTypes (as this is handled now by Typescript in a different file)
Is this correct? Can anyone shed some light on this? :)
Thanks in advance!!