react-json-form

1.4.3 • Public • Published

react-json-form Build Status

react-json-form is an attempt at simplifying the creation of forms that output nested JSON objects.

Installation

Yarn

$ yarn add react-json-form

NPM

$ npm install --save react-json-form

Usage

import React from 'react'
import { render } from 'react-dom'
import { BasicForm as Form, createInput } from 'react-json-form'
 
const Input = createInput(props => <input {...props} />)
 
render(
  <Form onSubmit={json => console.log(json)}>
    Name: <Input type="text" path="name" /><br />
    Age: <Input type="number" path="age" /><br />
    <button type="submit">Show me the JSON</button>
  </Form>,
  document.getElementById('root')
)

Readme

Keywords

none

Package Sidebar

Install

npm i react-json-form

Weekly Downloads

3

Version

1.4.3

License

MIT

Last publish

Collaborators

  • thezanke