Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remove FC usage from ArrayInput component #6617

Merged
merged 1 commit into from
Dec 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -57,23 +57,24 @@ import { ArrayInputContext } from './ArrayInputContext';
*
* @see https://github.com/final-form/react-final-form-arrays
*/
export const ArrayInput: FC<ArrayInputProps> = ({
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;
Expand Down