1.0.10 • Published 3 years ago

@jacob-hooks/use-input v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@jacob-hooks/use-input

React Hook to update input event

installation

yarn

yarn add @jacob-hooks/use-input

npm

npm i @jacob-hooks/use-input

Usage

import React from "react";
import useInput from "@jacob-hooks/use-input";

const App = () => {
  const maxLen = (value) => value.length <= 10;
  const name = useInput("Mr.", maxLen);

  return (
    <div className="App">
      <h1>Hello</h1>
      <input placeholder="Name" {...name} />
    </div>
  );
};

Arguments

ArgumentTypeDescriptionRequired
initialValuestringInitialValueyes
validatorfunctionName Valuenull
1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.1

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago