Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.52 KB

readme.md

File metadata and controls

52 lines (40 loc) · 1.52 KB

reforml

react form defined by yaml

NPM JavaScript Style Guide size gh-action Codacy Badge coverage dependencies

Install

npm i reforml

Usage

https://dipsywong98.github.io/reforml/

import {BaseForm} from 'reforml'
import React, {useState, useMemo} from 'react'

export default () => {
  const [value, setValue] = useState({})
  const fields = useMemo(() => ({
    myField: {
      type: 'text',
      label: 'my field'
    }
  }), [])
  return (
    <BaseForm fields={fields} value={value} onChange={setValue}/>
  )
}

Development

yarn # install dependencies to all packages
yarn start # start the build watcher for reforml
yarn example # start the example
yarn docs # start the development server of documentation

License

MIT © dipsywong98