@hookeasy/use-input

1.0.1 • Public • Published

@hookeasy/use-useInput

React Hook to update your useInput

install

npm i @hookeasy/use-useInput

or

yarn add @hookeasy/use-useInput

example

import React, { useState } from "react";
import ReactDOM from "react-dom";
import useInput from "@hookeasy/use-input";

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

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

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

/@hookeasy/use-input/

    Package Sidebar

    Install

    npm i @hookeasy/use-input

    Weekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    2.68 kB

    Total Files

    5

    Last publish

    Collaborators

    • baram