milesj / babel-plugin-typescript-to-proptypes

Generate React PropTypes from TypeScript interfaces or type aliases.
MIT License
367 stars 25 forks source link

Usage description #61

Open kbarinova opened 2 years ago

kbarinova commented 2 years ago

Hi, I could not figure out how to use your plugin to add propTypes to my current Typescript React components. I followed your current description, but could not see propTypes usage in my built code. Could you provide more details how to do that? Thanks in advance!

milesj commented 2 years ago

@kbarinova There's not much to do, just enable the plugin in your babel config: https://github.com/milesj/babel-plugin-typescript-to-proptypes#usage

And be sure that you're building with babel, not with tsc.