0.2.11 • Published 4 years ago

@peajs/form v0.2.11

Weekly downloads
14
License
MIT
Repository
github
Last release
4 years ago

@peajs/form

React Form base on hooks

English | 简体中文

Installation

npm i @peajs/form

Quickstart

import React from 'react'
import { useForm } from '@peajs/form'

class User {
  username = 'foo'
  password = ''
}

export default () => {
  const { handlers, name } = useForm(User, {
    onSubmit(values) {
      console.log('values:', values)
    },
  })

  return (
    <form onSubmit={handlers.handleSubmit}>
      <input {...name('username')} />
      <input {...name('password')} />
      <button type="submit">Submit</button>
    </form>
  )
}

License

MIT License

0.2.11

4 years ago

0.2.10

4 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago