hooks-react-useforms

0.1.5 • Public • Published

useInput

import

import { useInput } from 'react';

API

const [state, setStateFunc, changeFunc] = useInput("initialValue");
const App = () => {
    const [id, setId, changeId] = useInput("");
    const [password, setPassword, changePassword] = useInput("");
  
    return (
     <>
         <input 
                type="text" 
                name="id" 
                value={id} 
                onChange={changeId} 
            />
         <input 
                type="password" 
                name="password" 
                value={password} 
                onChange={changePassword} 
            />
        </>
    );
}

Package Sidebar

Install

npm i hooks-react-useforms

Weekly Downloads

4

Version

0.1.5

License

ISC

Unpacked Size

9.94 kB

Total Files

5

Last publish

Collaborators

  • yeong-g