diff --git a/test/test.tsx b/test/test.tsx
index 71b5500..b17f740 100644
--- a/test/test.tsx
+++ b/test/test.tsx
@@ -1,65 +1,70 @@
-import React, { useState } from 'react'
+import React from 'react'
import ReactDOM from 'react-dom'
-import { useForm, HTMLInputExtractor } from '../'
+import { useForm } from '../'
const TextError: React.FC<{ error?: string }> = ({ error }) => !error
- ? null
- :
{error}
+ ? null
+ : {error}
const Index: React.FC = () => {
- const { auto, form, update, errors } = useForm({
- username: '',
- password: '',
- type: 'formhero',
- awesome: true,
- }, {
- username: /^test/,
- password: {
- validator: /^.{3,}$/,
- message: 'To short',
- },
- awesome: (value) => !!value
- }, { extractor: HTMLInputExtractor })
+ const { auto, form, errors } = useForm({
+ username: '',
+ password: '',
+ type: 'formhero',
+ awesome: true,
+ }, {
+ username: /^test/,
+ password: {
+ validator: /^.{3,}$/,
+ message: 'To short',
+ },
+ awesome: (value) => !!value
+ })
- const _submit = (e: React.MouseEvent) => {
- e.preventDefault()
- console.log(form, errors)
- }
+ const _submit = (e: React.FormEvent) => {
+ e.preventDefault()
+ console.log(form, errors)
+ }
- return (
-
+ )
}
ReactDOM.render(, document.getElementById('root'))