File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -315,7 +315,11 @@ function Switch<T extends FieldValues>({
315315Form . Switch = Switch ;
316316
317317interface OTPProps < T extends FieldValues >
318- extends Omit < BaseInputProps < T > , "type" > {
318+ extends Omit < BaseInputProps < T > , "type" | "onChange" | "value" > ,
319+ Omit <
320+ React . ComponentProps < typeof InputOTP > ,
321+ "value" | "onChange" | "maxLength" | "name" | "render"
322+ > {
319323 maxLength ?: number ;
320324 children ?: React . ReactNode ;
321325 slotClassName ?: string ;
@@ -343,10 +347,10 @@ function OTP<T extends FieldValues>({
343347 { label && < FormLabel > { label } </ FormLabel > }
344348 < FormControl >
345349 < InputOTP
350+ { ...rest }
346351 maxLength = { maxLength }
347352 value = { String ( field . value || "" ) }
348353 onChange = { ( value : string ) => field . onChange ( value ) }
349- { ...( rest as any ) }
350354 >
351355 { children || (
352356 < InputOTPGroup className = { groupClassName } >
You can’t perform that action at this time.
0 commit comments