feat(Editor): implement dynamic fields

This commit is contained in:
Ali BARIN
2023-02-28 22:22:08 +00:00
parent d16e292231
commit c6b8f12f9a
11 changed files with 289 additions and 105 deletions

View File

@@ -38,9 +38,10 @@ export default function TextField(props: TextFieldProps): React.ReactElement {
required,
name,
defaultValue,
shouldUnregister,
clickToCopy,
readOnly,
shouldUnregister = true,
clickToCopy = false,
readOnly = false,
disabled = false,
onBlur,
onChange,
...textFieldProps
@@ -64,6 +65,7 @@ export default function TextField(props: TextFieldProps): React.ReactElement {
<MuiTextField
{...textFieldProps}
{...field}
disabled={disabled}
onChange={(...args) => {
controllerOnChange(...args);
onChange?.(...args);
@@ -85,10 +87,3 @@ export default function TextField(props: TextFieldProps): React.ReactElement {
/>
);
}
TextField.defaultProps = {
readOnly: false,
disabled: false,
clickToCopy: false,
shouldUnregister: false,
};