Skip to content

Commit 69b6418

Browse files
Remove object assign from examples
1 parent 1ccef8c commit 69b6418

17 files changed

+113
-48
lines changed

components/combobox/__examples__/base-custom-menu-item.jsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,17 @@ const accounts = [
5252
];
5353

5454
const accountsWithIcon = accounts.map((elem) =>
55-
Object.assign(elem, {
56-
icon: (
57-
<Icon
58-
assistiveText="Account"
59-
category="standard"
60-
size="x-small"
61-
name={elem.type}
62-
/>
63-
),
55+
({ ...elem,
56+
...{
57+
icon: (
58+
<Icon
59+
assistiveText="Account"
60+
category="standard"
61+
size="x-small"
62+
name={elem.type}
63+
/>
64+
)
65+
}
6466
})
6567
);
6668

components/combobox/__examples__/base-inherit-menu-width.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,16 @@ const accounts = [
4747
];
4848

4949
const accountsWithIcon = accounts.map((elem) =>
50-
Object.assign(elem, {
51-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
50+
({ ...elem,
51+
...{
52+
icon: (
53+
<Icon assistiveText="Account" category="standard" name={elem.type} />
54+
)
55+
}
5256
})
5357
);
5458

59+
5560
class Example extends React.Component {
5661
constructor (props) {
5762
super(props);

components/combobox/__examples__/base-menu-separator.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ const accounts = [
5454
];
5555

5656
const accountsWithIcon = accounts.map((elem) =>
57-
Object.assign(elem, {
58-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
57+
({ ...elem,
58+
...{
59+
icon: (
60+
<Icon assistiveText="Account" category="standard" name={elem.type} />
61+
)
62+
}
5963
})
6064
);
6165

components/combobox/__examples__/base-menu-subheader.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ const accounts = [
6060
];
6161

6262
const accountsWithIcon = accounts.map((elem) =>
63-
Object.assign(elem, {
64-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
63+
({ ...elem,
64+
...{
65+
icon: (
66+
<Icon assistiveText="Account" category="standard" name={elem.type} />
67+
)
68+
}
6569
})
6670
);
6771

components/combobox/__examples__/base-predefined-options-only.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ const accounts = [
5353
];
5454

5555
const accountsWithIcon = accounts.map((elem) =>
56-
Object.assign(elem, {
57-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
56+
({ ...elem,
57+
...{
58+
icon: (
59+
<Icon assistiveText="Account" category="standard" name={elem.type} />
60+
)
61+
}
5862
})
5963
);
6064

components/combobox/__examples__/base.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ const accounts = [
5252
];
5353

5454
const accountsWithIcon = accounts.map((elem) =>
55-
Object.assign(elem, {
56-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
55+
({ ...elem,
56+
...{
57+
icon: (
58+
<Icon assistiveText="Account" category="standard" name={elem.type} />
59+
)
60+
}
5761
})
5862
);
5963

components/combobox/__examples__/inline-multiple.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ const accounts = [
5252
];
5353

5454
const accountsWithIcon = accounts.map((elem) =>
55-
Object.assign(elem, {
56-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
55+
({ ...elem,
56+
...{
57+
icon: (
58+
<Icon assistiveText="Account" category="standard" name={elem.type} />
59+
)
60+
}
5761
})
5862
);
5963

components/combobox/__examples__/inline-single.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ const accounts = [
5252
];
5353

5454
const accountsWithIcon = accounts.map((elem) =>
55-
Object.assign(elem, {
56-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
55+
({ ...elem,
56+
...{
57+
icon: (
58+
<Icon assistiveText="Account" category="standard" name={elem.type} />
59+
)
60+
}
5761
})
5862
);
5963

components/combobox/__examples__/readonly-single-selection-custom-menu-item.jsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,17 @@ const accounts = [
5252
];
5353

5454
const accountsWithIcon = accounts.map((elem) =>
55-
Object.assign(elem, {
56-
icon: (
57-
<Icon
58-
assistiveText="Account"
59-
category="standard"
60-
size="x-small"
61-
name={elem.type}
62-
/>
63-
),
55+
({ ...elem,
56+
...{
57+
icon: (
58+
<Icon
59+
assistiveText="Account"
60+
category="standard"
61+
size="x-small"
62+
name={elem.type}
63+
/>
64+
)
65+
}
6466
})
6567
);
6668

components/combobox/__examples__/required-input-error-state.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ const accounts = [
5252
];
5353

5454
const accountsWithIcon = accounts.map((elem) =>
55-
Object.assign(elem, {
56-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
55+
({ ...elem,
56+
...{
57+
icon: (
58+
<Icon assistiveText="Account" category="standard" name={elem.type} />
59+
)
60+
}
5761
})
5862
);
5963

components/combobox/__examples__/snapshot/base-open-class-name.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ const accounts = [
2626
];
2727

2828
const accountsWithIcon = accounts.map((elem) =>
29-
Object.assign(elem, {
30-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
29+
({ ...elem,
30+
...{
31+
icon: (
32+
<Icon assistiveText="Account" category="standard" name={elem.type} />
33+
)
34+
}
3135
})
3236
);
3337

components/combobox/__examples__/snapshot/base-open.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ const accounts = [
2121
];
2222

2323
const accountsWithIcon = accounts.map((elem) =>
24-
Object.assign(elem, {
25-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
24+
({ ...elem,
25+
...{
26+
icon: (
27+
<Icon assistiveText="Account" category="standard" name={elem.type} />
28+
)
29+
}
2630
})
2731
);
2832

components/combobox/__examples__/snapshot/base-selected.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ const accounts = [
2121
];
2222

2323
const accountsWithIcon = accounts.map((elem) =>
24-
Object.assign(elem, {
25-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
24+
({ ...elem,
25+
...{
26+
icon: (
27+
<Icon assistiveText="Account" category="standard" name={elem.type} />
28+
)
29+
}
2630
})
2731
);
2832

components/combobox/__examples__/snapshot/inline-multiple-selection-selected.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ const accounts = [
5252
];
5353

5454
const accountsWithIcon = accounts.map((elem) =>
55-
Object.assign(elem, {
56-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
55+
({ ...elem,
56+
...{
57+
icon: (
58+
<Icon assistiveText="Account" category="standard" name={elem.type} />
59+
)
60+
}
5761
})
5862
);
5963

components/combobox/__examples__/snapshot/inline-multiple-selection.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ const accounts = [
5252
];
5353

5454
const accountsWithIcon = accounts.map((elem) =>
55-
Object.assign(elem, {
56-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
55+
({ ...elem,
56+
...{
57+
icon: (
58+
<Icon assistiveText="Account" category="standard" name={elem.type} />
59+
)
60+
}
5761
})
5862
);
5963

components/combobox/__examples__/snapshot/inline-single-selection-selected.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ const accounts = [
5252
];
5353

5454
const accountsWithIcon = accounts.map((elem) =>
55-
Object.assign(elem, {
56-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
55+
({ ...elem,
56+
...{
57+
icon: (
58+
<Icon assistiveText="Account" category="standard" name={elem.type} />
59+
)
60+
}
5761
})
5862
);
5963

components/combobox/__examples__/snapshot/inline-single-selection.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ const accounts = [
5252
];
5353

5454
const accountsWithIcon = accounts.map((elem) =>
55-
Object.assign(elem, {
56-
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
55+
({ ...elem,
56+
...{
57+
icon: (
58+
<Icon assistiveText="Account" category="standard" name={elem.type} />
59+
)
60+
}
5761
})
5862
);
5963

0 commit comments

Comments
 (0)