score:1

interface MyTextFieldProps extends StandardTextFieldProps {
  isEditable?: boolean;
  // send in any other props necessary to render your non editable
  // portion
}

const MyTextField: FC<MyTextFieldProps> = (props) => {
  const { isEditable, ...other } = props;
  return <>{props.isEditable ? <TextField {...other}></TextField> : <span>text:{props.value}</span>}</>;
};

Related Query

More Query from same tag