import { TextField as MuiTextField } from '@material-ui/core'; import { TextFieldProps as MuiTextFieldProps } from '@material-ui/core/TextField'; import React from 'react'; import { useFormContext, Controller } from 'react-hook-form'; import { BaseProps } from './props'; export interface TextFieldProps extends BaseProps, Omit {} const TextField = ({ name, rules, defaultValue, ...rest }: TextFieldProps) => { const { control, errors } = useFormContext(); return ( ( { onChange(event.target.value); }} value={value} name={name} /> )} defaultValue={defaultValue || ''} /> ); }; export default TextField;