Chilean RUT for React
npm install react-rutThe goal of this bundle is provide a chilean RUT utilities for [React].
with NPM:
``bash`
npm install react-rut
with Yarn:
`bash`
yarn add react-rut
`tsx
import React from 'react';
import { useRut } from 'react-rut';
const Component: React.FC = () => {
// you can set a default value with "useRut('1-9')"
const [{ formattedValue }, setRut] = useRut();
return (
value={formattedValue}
onChange={(e) => setRut(e.target.value)}
/>
);
};
export default Component;
`
`bash``
npm run test