1.1.5 • Published 2 years ago

react-props-to-json-ts v1.1.5

Weekly downloads
7
License
MIT
Repository
github
Last release
2 years ago

react-props-to-json-ts

React props to json schema used for form-reder

Install

yarn add react-props-to-json-ts --dev

or

npm install --save-dev react-props-to-json-ts

How to use

const propsToJSON = require('react-props-to-json-ts');
// input file path
const result = propsToJSON('filename.tsx');

console.log(result);

API

(path, handleError)

argumenttyperequireddescription
pathstringtrueThe path of parsing file
handleError(err: any) => voidfalseCallback for handle the error

Note

  • The tool will skip the prop without @title tag.
  • The component also need a @title tag, otherwise will get null.
  • If props is empty, will get a null value.

Example

pls follow the exmaple

Support types

typeformat
unionselect
numberinput number
booleancheckbox
stringinput
objectauto
arrayauto
ReactNoderichtext
1.1.5

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago