|
1 | 1 | import React, { memo, useReducer } from 'react'; |
2 | 2 | import isEqual from 'lodash/isEqual'; |
3 | | -import PropTypes from 'prop-types'; |
4 | 3 | import { useFieldApi, useFormApi, FieldArray } from '@data-driven-forms/react-form-renderer'; |
5 | 4 | import { Row, Col, Button, Typography, Space } from 'antd'; |
6 | 5 | import { UndoOutlined, RedoOutlined } from '@ant-design/icons'; |
@@ -44,20 +43,6 @@ const ArrayItem = memo( |
44 | 43 | ({ remove: _prevRemove, ...prev }, { remove: _nextRemove, ...next }) => isEqual(prev, next) |
45 | 44 | ); |
46 | 45 |
|
47 | | -ArrayItem.propTypes = { |
48 | | - name: PropTypes.string, |
49 | | - fieldIndex: PropTypes.number.isRequired, |
50 | | - fields: PropTypes.arrayOf(PropTypes.object), |
51 | | - remove: PropTypes.func.isRequired, |
52 | | - length: PropTypes.number, |
53 | | - minItems: PropTypes.number, |
54 | | - removeLabel: PropTypes.node.isRequired, |
55 | | - ArrayItemProps: PropTypes.object.isRequired, |
56 | | - FieldsContainerProps: PropTypes.object.isRequired, |
57 | | - RemoveContainerProps: PropTypes.object.isRequired, |
58 | | - RemoveButtonProps: PropTypes.object.isRequired, |
59 | | -}; |
60 | | - |
61 | 46 | const defaultButtonLabels = { |
62 | 47 | add: 'ADD', |
63 | 48 | remove: 'REMOVE', |
@@ -247,32 +232,4 @@ const DynamicArray = ({ ...props }) => { |
247 | 232 | ); |
248 | 233 | }; |
249 | 234 |
|
250 | | -DynamicArray.propTypes = { |
251 | | - label: PropTypes.node, |
252 | | - description: PropTypes.node, |
253 | | - fields: PropTypes.arrayOf(PropTypes.object).isRequired, |
254 | | - defaultItem: PropTypes.any, |
255 | | - minItems: PropTypes.number, |
256 | | - maxItems: PropTypes.number, |
257 | | - noItemsMessage: PropTypes.node, |
258 | | - buttonLabels: PropTypes.object, |
259 | | - // customization props |
260 | | - FormItemProps: PropTypes.object, |
261 | | - ArrayItemProps: PropTypes.object, |
262 | | - FieldsContainerProps: PropTypes.object, |
263 | | - RemoveContainerProps: PropTypes.object, |
264 | | - RemoveButtonProps: PropTypes.object, |
265 | | - FieldArrayRowProps: PropTypes.object, |
266 | | - FieldArrayRowCol: PropTypes.object, |
267 | | - FieldArrayHeaderProps: PropTypes.object, |
268 | | - FieldArrayLabelProps: PropTypes.object, |
269 | | - FieldArrayButtonsProps: PropTypes.object, |
270 | | - UndoButtonProps: PropTypes.object, |
271 | | - RedoButtonProps: PropTypes.object, |
272 | | - AddButtonProps: PropTypes.object, |
273 | | - FieldArrayDescriptionProps: PropTypes.object, |
274 | | - NoItemsMessageProps: PropTypes.object, |
275 | | - ErrorMessageProps: PropTypes.object, |
276 | | -}; |
277 | | - |
278 | 235 | export default DynamicArray; |
0 commit comments