import React from 'react' import { useForm } from '../' import { mount } from './common' const Index: React.FC = () => { const { field, form, errors, isValid } = useForm( { username: '', email: '', password: '', }, { rules: { username: (value) => value.length > 3, email: { rule: /@/, message: 'Must contain an @', }, password: [ { rule: /[A-Z]/, message: 'Must contain an uppercase letter', }, { rule: /[\d]/, message: 'Must contain a digit', }, ], }, } ) return (
) } mount(Index)