1.0.10 • Published 4 years ago

@jacob-hooks/use-input v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
4 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

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.1

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago