@hookeasy/use-input
v1.0.1
Published
React Hook to update your useInput
Downloads
1
Readme
@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);