1.0.2 • Published 4 years ago

@yeong-g/useform v1.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

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} 
            />
        </>
    );
}