fix issue with editing users without 'name'
This commit is contained in:
parent
281a0ed4e7
commit
7ff79db6af
4 changed files with 15 additions and 8 deletions
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import { useController } from 'react-hook-form';
|
||||
|
||||
/* eslint-disable react/react-in-jsx-scope */
|
||||
export const Input = ({ control, name, type = 'text', label, ...props }: InputProps) => {
|
||||
export const Input = ({ control, name, type = 'text', label, required, ...props }: InputProps) => {
|
||||
const {
|
||||
field,
|
||||
// fieldState: { invalid, isTouched, isDirty },
|
||||
|
|
@ -10,7 +10,7 @@ export const Input = ({ control, name, type = 'text', label, ...props }: InputPr
|
|||
} = useController({
|
||||
name,
|
||||
control,
|
||||
rules: { required: true },
|
||||
rules: { required },
|
||||
defaultValue: '',
|
||||
});
|
||||
|
||||
|
|
|
|||
Reference in a new issue