1.0.1 • Published 2 years ago

@sutiles/react-form-handler v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

React Forumu

Simple and powerful form handler for React (TypeScript support)

Important

At the moment, this library can only be used as a react hook.

Sections

Installation

Install as package with npm:

npm install @sutiles/react-form-handler

Setup

Example

import React from 'react';
import { useForumu } from '@sutiles/react-form-handler';

export default function Login() {
  const { values, submitHandler } = useFormHandler({
    initValues: {
      email: '',
      password: '',
    },
  });

  const onSubmit = submitHandler(({ email, password }) => {
    signIn(email, password);
  });

  return (
    <form onSubmit={onSubmit}>
      <input {...setInput('email')} />
      <input {...setInput('password', { type: 'password' })} />
      <button type='submit'>Login</button>
    </form>
  );
}

Settings

soon more information

1.0.1

2 years ago

1.0.0

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago