Skip to content

Commit

Permalink
docs: update render method's params of react form hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanttcat committed Mar 5, 2022
1 parent 935e460 commit a711d12
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 11 additions & 11 deletions docs/3.0.x/react-hooks-forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function FormHookExample() {
<FormControl.Label>First Name</FormControl.Label>
<Controller
control={control}
render={({ onChange, onBlur, value }) => (
render={({field: { onChange, onBlur, value }}) => (
<Input
onBlur={onBlur}
placeholder="John"
Expand All @@ -49,7 +49,7 @@ function FormHookExample() {
<FormControl.Label>Last Name</FormControl.Label>
<Controller
control={control}
render={({ onChange, onBlur, value }) => (
render={({field: { onChange, onBlur, value }}) => (
<Input
onBlur={onBlur}
placeholder="Doe"
Expand All @@ -68,7 +68,7 @@ function FormHookExample() {
<FormControl.Label>Age</FormControl.Label>
<Controller
control={control}
render={({ onChange, onBlur, value }) => (
render={({field: { onChange, onBlur, value }}) => (
<Input
onBlur={onBlur}
placeholder="24"
Expand Down Expand Up @@ -128,7 +128,7 @@ function FormHookCheckboxExample() {
<FormControl.Label>Hobbies</FormControl.Label>
<Controller
control={control}
render={({ onChange }) => (
render={({field: { onChange }}) => (
<Checkbox.Group
onChange={(values) => {
onChange(values);
Expand Down Expand Up @@ -179,7 +179,7 @@ function FormHookCheckboxExample() {
<FormControl.Label>Gender</FormControl.Label>
<Controller
control={control}
render={({ onChange }) => (
render={({field: { onChange }}) => (
<Radio.Group
name="gender"
flexDirection="row"
Expand Down Expand Up @@ -240,7 +240,7 @@ function FormHookSelectExample() {
<FormControl.Label>Fav language:</FormControl.Label>
<Controller
control={control}
render={({ onChange, value }) => (
render={({field: { onChange, value }}) => (
<Select
placeholder="Pick language"
selectedValue={value}
Expand Down Expand Up @@ -308,7 +308,7 @@ function FormHookSliderExample() {
<FormControl.Label>Amount you like NativeBase</FormControl.Label>
<Controller
control={control}
render={({ onChange, value }) => (
render={({field: { onChange, value }}) => (
<Slider onChange={(val) => onChange(val)} defaultValue={value}>
<Slider.Track>
<Slider.FilledTrack />
Expand Down Expand Up @@ -363,7 +363,7 @@ function FormHookTextareaExample() {
<FormControl.Label>What do you think?</FormControl.Label>
<Controller
control={control}
render={({ onChange, value }) => (
render={({field: { onChange, value }}) => (
<TextArea
placeholder="TextArea"
onChangeText={(val) => onChange(val)}
Expand Down Expand Up @@ -417,7 +417,7 @@ function FormHookSwitchExample() {
<FormControl.Label>Remenber me:</FormControl.Label>
<Controller
control={control}
render={({ onChange, value }) => (
render={({field: { onChange, value }}) => (
<Switch
onToggle={(val: boolean) => onChange(val)}
isChecked={value}
Expand Down Expand Up @@ -474,7 +474,7 @@ function FormHookNumberInputExample() {
<FormControl.Label>Current Native Base Version:</FormControl.Label>
<Controller
control={control}
render={({ onChange, value }) => (
render={({field: { onChange, value }}) => (
<NumberInput
onChange={(val: any) => onChange(val)}
defaultValue={value}
Expand Down Expand Up @@ -534,7 +534,7 @@ function FormHookPinInputExample() {
<FormControl.Label>OTP:</FormControl.Label>
<Controller
control={control}
render={({ onChange, value }) => (
render={({field: { onChange, value }}) => (
<PinInput onChange={(val: any) => onChange(val)} value={value}>
<PinInputField />
<PinInputField />
Expand Down
22 changes: 11 additions & 11 deletions docs/3.1.x/react-hooks-forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function FormHookExample() {
<FormControl.Label>First Name</FormControl.Label>
<Controller
control={control}
render={({ onChange, onBlur, value }) => (
render={({field: { onChange, onBlur, value }}) => (
<Input
onBlur={onBlur}
placeholder="John"
Expand All @@ -49,7 +49,7 @@ function FormHookExample() {
<FormControl.Label>Last Name</FormControl.Label>
<Controller
control={control}
render={({ onChange, onBlur, value }) => (
render={({field: { onChange, onBlur, value }}) => (
<Input
onBlur={onBlur}
placeholder="Doe"
Expand All @@ -68,7 +68,7 @@ function FormHookExample() {
<FormControl.Label>Age</FormControl.Label>
<Controller
control={control}
render={({ onChange, onBlur, value }) => (
render={({field: { onChange, onBlur, value }}) => (
<Input
onBlur={onBlur}
placeholder="24"
Expand Down Expand Up @@ -128,7 +128,7 @@ function FormHookCheckboxExample() {
<FormControl.Label>Hobbies</FormControl.Label>
<Controller
control={control}
render={({ onChange }) => (
render={({field: { onChange }}) => (
<Checkbox.Group
onChange={(values) => {
onChange(values);
Expand Down Expand Up @@ -179,7 +179,7 @@ function FormHookCheckboxExample() {
<FormControl.Label>Gender</FormControl.Label>
<Controller
control={control}
render={({ onChange }) => (
render={({field: { onChange }}) => (
<Radio.Group
name="gender"
flexDirection="row"
Expand Down Expand Up @@ -240,7 +240,7 @@ function FormHookSelectExample() {
<FormControl.Label>Fav language:</FormControl.Label>
<Controller
control={control}
render={({ onChange, value }) => (
render={({field: { onChange, value }}) => (
<Select
placeholder="Pick language"
selectedValue={value}
Expand Down Expand Up @@ -308,7 +308,7 @@ function FormHookSliderExample() {
<FormControl.Label>Amount you like NativeBase</FormControl.Label>
<Controller
control={control}
render={({ onChange, value }) => (
render={({field: { onChange, value }}) => (
<Slider onChange={(val) => onChange(val)} defaultValue={value}>
<Slider.Track>
<Slider.FilledTrack />
Expand Down Expand Up @@ -363,7 +363,7 @@ function FormHookTextareaExample() {
<FormControl.Label>What do you think?</FormControl.Label>
<Controller
control={control}
render={({ onChange, value }) => (
render={({field: { onChange, value }}) => (
<TextArea
placeholder="TextArea"
onChangeText={(val) => onChange(val)}
Expand Down Expand Up @@ -417,7 +417,7 @@ function FormHookSwitchExample() {
<FormControl.Label>Remenber me:</FormControl.Label>
<Controller
control={control}
render={({ onChange, value }) => (
render={({field: { onChange, value }}) => (
<Switch
onToggle={(val: boolean) => onChange(val)}
isChecked={value}
Expand Down Expand Up @@ -474,7 +474,7 @@ function FormHookNumberInputExample() {
<FormControl.Label>Current Native Base Version:</FormControl.Label>
<Controller
control={control}
render={({ onChange, value }) => (
render={({field: { onChange, value }}) => (
<NumberInput
onChange={(val: any) => onChange(val)}
defaultValue={value}
Expand Down Expand Up @@ -534,7 +534,7 @@ function FormHookPinInputExample() {
<FormControl.Label>OTP:</FormControl.Label>
<Controller
control={control}
render={({ onChange, value }) => (
render={({field: { onChange, value }}) => (
<PinInput onChange={(val: any) => onChange(val)} value={value}>
<PinInputField />
<PinInputField />
Expand Down

0 comments on commit a711d12

Please sign in to comment.