Skip to content

Controlled Select Not working as expected #209

Answered by yjose
premdasvm asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @premdasvm, yeah sure here is an example of login screen with role attribute

import { zodResolver } from '@hookform/resolvers/zod';
import React from 'react';
import type { SubmitHandler } from 'react-hook-form';
import { useForm } from 'react-hook-form';
import * as z from 'zod';

import { Button, ControlledInput, ControlledSelect, Text, View } from '@/ui';

const schema = z.object({
  name: z.string().optional(),
  email: z
    .string({
      required_error: 'Email is required',
    })
    .email('Invalid email format'),
  role: z.enum(['admin', 'user', 'moderator']),
  password: z
    .string({
      required_error: 'Password is required',
    })
    .min(6, 'Password must be at l…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@premdasvm
Comment options

Answer selected by premdasvm
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants