Huge News!Announcing our $40M Series B led by Abstract Ventures.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
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc