Skip to content

React Hook Form with Select component on React Native #8187

Answered by bluebill1049
lyqht asked this question in Q&A
Discussion options

You must be logged in to vote

https://snack.expo.dev/@bluebill1049/react-hook-form-with-ui-kitten-select

import { IndexPath, Select, SelectItem, Text } from '@ui-kitten/components';
import React from 'react';
import { Controller, useForm } from 'react-hook-form';
import { StyleSheet, TouchableOpacity, View } from 'react-native';

const timeUnitOptions = ['days', 'hours', 'weeks'];

const ReminderForm = ({ onSubmit }) => {
  const [selectedIndex, setSelectedIndex] = React.useState(new IndexPath(2));
  const {
    control,
    handleSubmit,
    formState: { errors },
  } = useForm({
    mode: 'onBlur',
    defaultValues: {
      timeUnit: 'weeks',
    },
  });

  return (
    <View style={styles.container}>
      <Text c…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@lyqht
Comment options

@bluebill1049
Comment options

@JaissonB
Comment options

Answer selected by lyqht
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants