0.0.1 • Published 6 years ago

cuneiform v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Cuneiform

Simple and Declarative React Forms

Install

npm i cuneiform

Example

import React from 'react';
import Form from 'cuneiform';

export default Create({ onSubmit }) {
  return (
    <Form onSubmit={onSubmit}>
     {({ getValue, setValue, resetForm }) => {
       return (
         <React.Fragment>
           <input
             name="name"
             type="text"
             value={getValue("name")}
             onChange={setValue}
           />
           <input
              name="superhero-name"
              type="text"
              value={getValue("superhero-name")}
              onChange={setValue}
            />
           <button onClick={resetForm}>Reset</button>
           <button type="submit">Submit</button>
         </React.Fragment>
       );
     }}
    </Form>
  )
)