New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-ava-form

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-ava-form

- Simple Clone of React Hook Forms

0.0.4
latest
Source
npm
Version published
Maintainers
1
Created
Source

Features

  • Simple Clone of React Hook Forms

Install

  npm install react-ava-form

Example

  • https://codesandbox.io/s/react-ava-form-npm-example-3hgned

Start

import { useForm } from "react-ava-form";

const FormComponent = () => {
  const { onSubmit, register } = useForm();

  const handleOnSubmit = (event: React.FormEvent<HTMLFormElement>) => {
    const data = onSubmit(event);
  };

  return (
    <form onSubmit={handleOnSubmit}>
      <input type="text" {...register("test1", "default 1")} />
      <button type="submit">Submit</button>
    </form>
  );
};

export default FormComponent;

Parameters

Register Fields

const { register } = useForm();

Call register in your field you want to register to the hook.

Parameters

register(id: string, defaultValue: string | number)

Register needs to be called like this:

  <input type="text" {...register(id, defaultValue)} />

Keywords

react

FAQs

Package last updated on 31 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts