You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 14, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+54-21Lines changed: 54 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,10 +41,12 @@
41
41
42
42
## Demo
43
43
44
-
Check out this <ahref="https://codesandbox.io/s/react-hook-form-hookforminput-rzu9s">demo</a>.
44
+
Check out this <ahref="https://codesandbox.io/s/react-hook-form-hookforminput-rzu9s">React Web demo</a> or <ahref="https://snack.expo.io/@bluebill1049/test-react-hook-form-input">React Native demo</a>.
45
45
46
46
## Quickstart
47
47
48
+
#### React Web
49
+
48
50
```jsx
49
51
importReactfrom'react';
50
52
importuseFormfrom'react-hook-form';
@@ -54,7 +56,6 @@ import Select from 'react-select';
|`name`| string | ✓ || Unique name to register the custom input |
94
-
|`setValue`| Function ||| (optional when using <ahref="https://react-hook-form.com/api#FormContext">FormContext</a>) React Hook Form <ahref="https://react-hook-form.com/api#setValue">setValue</a> function |
95
-
|`register`| Function ||| (optional when using <ahref="https://react-hook-form.com/api#FormContext">FormContext</a>) React Hook Form <ahref="https://react-hook-form.com/api#register">register</a> function |
96
-
|`unregister`| Function ||| (optional when using <ahref="https://react-hook-form.com/api#FormContext">FormContext</a>) React Hook Form <ahref="https://react-hook-form.com/api#unregister">unregister</a> function |
97
-
|`mode`| string ||`onSubmit`| <ahref="https://react-hook-form.com/api#useForm">Mode</a> option for triggering validation |
98
-
|`rules`| Object ||`undefined`| Validation rules according to <ahref="https://react-hook-form.com/api#register">register</a> at React Hook Form |
99
-
|`type`| string ||`input`| Currently support `checkbox` or `input` input type includes: `radio` and `select`|
100
-
|`...rest`| Object ||| Any props assigned will be pass through to your Input component |
|`name`| string | ✓ || Unique name to register the custom input |
123
+
|`setValue`| Function ||| (optional when using <ahref="https://react-hook-form.com/api#FormContext">FormContext</a>) React Hook Form <ahref="https://react-hook-form.com/api#setValue">setValue</a> function |
124
+
|`register`| Function ||| (optional when using <ahref="https://react-hook-form.com/api#FormContext">FormContext</a>) React Hook Form <ahref="https://react-hook-form.com/api#register">register</a> function |
125
+
|`unregister`| Function ||| (optional when using <ahref="https://react-hook-form.com/api#FormContext">FormContext</a>) React Hook Form <ahref="https://react-hook-form.com/api#unregister">unregister</a> function |
126
+
|`mode`| string ||`onSubmit`| <ahref="https://react-hook-form.com/api#useForm">Mode</a> option for triggering validation |
127
+
|`rules`| Object ||`undefined`| Validation rules according to <ahref="https://react-hook-form.com/api#register">register</a> at React Hook Form |
128
+
|`type`| string ||`input`| Currently support `checkbox` or `input` input type includes: `radio` and `select`|
129
+
|`onChangeName`| string ||| This prop allow you to target that specific event name, eg: when `onChange` event is named `onTextChange`|
130
+
|`onChangeEvent`| Function ||| Callback function to return `value` or `checked`. event callback argument may have different signature and this props allow you to customise the value return. |
131
+
|`onBlurName`| string ||| This prop allow you to target that specific event name, eg: when `onBlur` event is named `onTextBlur`|
132
+
|`onBlurEvent`| Function ||| Callback function to return `value` or `checked`. event callback argument may have different signature and this props allow you to customise the value return. |
133
+
|`...rest`| Object ||| Any props assigned will be pass through to your Input component |
0 commit comments