Skip to content

Commit b5989f9

Browse files
committed
Review fixes
1 parent bc7d1de commit b5989f9

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

packages/mui-component-mapper/src/files/field-array.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ import React, { useReducer } from 'react';
22
import PropTypes from 'prop-types';
33
import { useFormApi, FieldArray } from '@data-driven-forms/react-form-renderer';
44

5-
import Grid from '@material-ui/core/Grid';
6-
import Button from '@material-ui/core/Button';
7-
import Typography from '@material-ui/core/Typography';
8-
import FormControl from '@material-ui/core/FormControl';
9-
import FormHelperText from '@material-ui/core/FormHelperText';
5+
import { Grid, Button, Typography, FormControl, FormHelperText, IconButton } from '@material-ui/core';
6+
107
import { makeStyles } from '@material-ui/core/styles';
118
import RedoIcon from '@material-ui/icons/Redo';
129
import UndoIcon from '@material-ui/icons/Undo';
13-
import IconButton from '@material-ui/core/IconButton';
1410

1511
import { useFieldApi } from '@data-driven-forms/react-form-renderer';
1612

@@ -157,13 +153,11 @@ const DynamicArray = ({ ...props }) => {
157153

158154
const undo = () => {
159155
push(state.history[state.index - 1].value);
160-
161156
dispatch({ type: 'undo' });
162157
};
163158

164159
const redo = () => {
165160
remove(value.length - 1);
166-
167161
dispatch({ type: 'redo' });
168162
};
169163

@@ -198,7 +192,7 @@ const DynamicArray = ({ ...props }) => {
198192
) : (
199193
map((name, index) => (
200194
<ArrayItem
201-
key={`${name}-${index}`}
195+
key={name}
202196
fields={formFields}
203197
name={name}
204198
fieldIndex={index}

packages/react-renderer-demo/src/app/src/doc-components/mui-field-array.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MUI component mapper provides an experimental implementation of PF4 field arrays.
1+
MUI component mapper provides an experimental implementation of field array.
22

33
**Props**
44

packages/react-renderer-demo/src/app/src/doc-components/pf4-field-array.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PF4 component mapper provides an experimental implementation of PF4 field arrays.
1+
PF4 component mapper provides an experimental implementation of field array.
22

33
**Props**
44

0 commit comments

Comments
 (0)