1.0.5 • Published 5 years ago

lomake v1.0.5

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

Form handling tool for react app's

example at codesandbox

import React from 'react'
import { useLomake } from 'lomake'

const initialState = {
  values: { firstName: '', lastName: '' },
}

function validator(values) {
  let errors = {}
  if (!values.firstName) errors.firstName = 'required'
  return errors
}

function handleSubmit(values) {
  return new Promise(...)
}

function YourForm(props) {
  const {
    values,
    errors,
    touched,
    focus,
    isValidating,
    isSubmitting,
    eventHandlers:{
      onChange,
      onBlur,
      onFocus
    } = useLomake({ initialState, validator, handleSubmit })

  return (
    ...
  )
}
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3-1

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago