Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update render method's params of react form hook #268

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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