From ffa3c21ec1c2107ee79c033de46a9a504375f0cf Mon Sep 17 00:00:00 2001 From: asvarcas Date: Sat, 25 Sep 2021 20:43:43 -0300 Subject: [PATCH] Fix remove FC usage from ArrayInput component --- .../src/input/ArrayInput/ArrayInput.tsx | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.tsx b/packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.tsx index 0c976aa86b6..3889bb4f2d3 100644 --- a/packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.tsx +++ b/packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { cloneElement, Children, FC, ReactElement } from 'react'; +import { cloneElement, Children, ReactElement } from 'react'; import PropTypes from 'prop-types'; import { isRequired, @@ -57,23 +57,24 @@ import { ArrayInputContext } from './ArrayInputContext'; * * @see https://github.com/final-form/react-final-form-arrays */ -export const ArrayInput: FC = ({ - className, - defaultValue, - label, - loaded, - loading, - children, - helperText, - record, - resource, - source, - validate, - variant, - disabled, - margin = 'dense', - ...rest -}) => { +export const ArrayInput = (props: ArrayInputProps) => { + const { + className, + defaultValue, + label, + loaded, + loading, + children, + helperText, + record, + resource, + source, + validate, + variant, + disabled, + margin = 'dense', + ...rest + } = props; const sanitizedValidate = Array.isArray(validate) ? composeSyncValidators(validate) : validate;