A React Custom Hook that allows to format and verify Rut (Chilean DNI).
npm install use-rut
...
import useRut from 'use-rut';
function App() {
const [rut, valido, setRut] = useRut();
return (
<div className="App">
<input onChange={(e) => setRut(e.target.value)} value={rut}/>
<h2>{`valido: ${valido}`}</h2>
</div>
);
}
Carlos Fernández
You can follow me on github
Copyright © 2021 UseRut Hook.