Convert JSON to React PropTypes
Online REPL is available at https://transform.now.sh/
npm i -D babel-plugin-json-to-proptypes
import { transform } from "babel-core"
import jsonToProptypes from "babel-plugin-json-to-proptypes"
const json = `{
a: 'b'
}`
const { code } = transform(json, {
plugins: [jsonToProptypes]
})
console.log(code)
// const propTypes = {
// a: PropTypes.string
// }
MIT @ Ritesh Kumar
Thanks goes to these wonderful people (emoji key):
Ritesh Kumar 📖 💻 🤔 |
---|
This project follows the all-contributors specification. Contributions of any kind welcome!