Naivete Precedes Misrepresentation

    @jacob-hooks/use-input

    1.0.10 • Public • Published

    @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

    Argument Type Description Required
    initialValue string InitialValue yes
    validator function Name Value null

    Install

    npm i @jacob-hooks/use-input

    DownloadsWeekly Downloads

    0

    Version

    1.0.10

    License

    MIT

    Unpacked Size

    3.7 kB

    Total Files

    6

    Last publish

    Collaborators

    • jacobko