diff --git a/src/components/ArrayInput.tsx b/src/components/ArrayInput.tsx index 98e97a07..b0ad9adb 100644 --- a/src/components/ArrayInput.tsx +++ b/src/components/ArrayInput.tsx @@ -13,12 +13,12 @@ export interface ArrayInputProps extends ThemeProps, LocaleProps { value?: Array; onChange?: (value: Array) => void; placeholder: string; - itemRender: ( - value: any, - onChange: (value: any) => void, - index: number, - disabled?: boolean - ) => JSX.Element; + itemRender: (props: { + value: any; + onChange: (value: any) => void; + index: number; + disabled?: boolean; + }) => JSX.Element; itemInitalValue?: any; maxLength?: number; minLength?: number; @@ -33,9 +33,15 @@ export interface ArrayInputProps extends ThemeProps, LocaleProps { export class ArrayInput extends React.Component { static defaultProps = { placeholder: '<çİş>', - itemRender: (value: any, onChange: (value: any) => void, index: number) => ( - - ) + itemRender: ({ + value, + onChange + }: { + value: any; + onChange: (value: any) => void; + index: number; + disabled?: boolean; + }) => }; id: string = guid(); @@ -144,12 +150,12 @@ export class ArrayInput extends React.Component { ) : null} - {itemRender( + {itemRender({ value, - this.handleItemOnChange.bind(this, index), + onChange: this.handleItemOnChange.bind(this, index), index, disabled - )} + })} {removable !== false && !disabled &&