Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
paales committed Feb 27, 2025
1 parent a4d6a79 commit 0c4790d
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ import { TextField, useForkRef } from '@mui/material'
import React, { useState } from 'react'
import type { BaseControllerProps, FieldElementProps } from './types'

type ShowValidProps = { showValid?: boolean }
type InternalProps = {
showValid?: boolean
/** Cast all values as a string instead of a string/number/date depending on the input type. */
asString?: boolean
}

export type TextFieldElementProps<TFieldValues extends FieldValues = FieldValues> =
FieldElementProps<TFieldValues, TextFieldProps> & ShowValidProps
FieldElementProps<TFieldValues, TextFieldProps> & InternalProps

type TextFieldElementComponent = <TFieldValues extends FieldValues>(
props: TextFieldElementProps<TFieldValues>,
Expand Down Expand Up @@ -55,7 +59,7 @@ function TextFieldElementBase(props: TextFieldElementProps): JSX.Element {
showValid,
asString = false,
...rest
} = props as TextFieldProps & ShowValidProps & BaseControllerProps
} = props as TextFieldProps & InternalProps & BaseControllerProps

if (required && !rules.required) {
rules.required = i18n._(/* i18n */ 'This field is required')
Expand Down

0 comments on commit 0c4790d

Please sign in to comment.