importReactfrom"react";importuseInputfrom"@chae_hook/use-Input";functionApp=()=>{constmaxLen=value=>value.length<=20;constname=useInput("Ms: ",maxLen);console.log(name)return(<divclassName="App"><h1> What is your name?</h1><inputplaceholder="Name"{...name}/></div>);};
Arguments
Argument
Type
Description
Required
initialValue
string
String to show in placeholder by default
yes
validator
function
Function to be add validation
yes
Return
Return value
Type
Description
Default value
name
Object
A object containing string value whici can be inputted in placeholder and function onChange which can be used for adding validation.