babel-plugin-typescript-to-proptypes icon indicating copy to clipboard operation
babel-plugin-typescript-to-proptypes copied to clipboard

Usage description

Open kbarinova opened this issue 3 years ago • 1 comments

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!

kbarinova avatar Feb 04 '22 15:02 kbarinova

@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.

milesj avatar Feb 04 '22 18:02 milesj