Skip to content

Commit 9e2ea5c

Browse files
author
Julien Castelain
committed
Change forEach for some
1 parent ed79f86 commit 9e2ea5c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/components/buttons/button-color.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class ButtonColor extends React.Component {
9595

9696
const colors = this._getColors();
9797

98-
colors.forEach(item => {
98+
colors.some(item => {
9999
if (this._checkActive(item.style)) {
100100
activeColor = item.name;
101101

@@ -188,10 +188,11 @@ class ButtonColor extends React.Component {
188188
}
189189

190190
/**
191-
* Returns an array of colors. Each color consists from two properties:
192-
* - name - the style name, for example "default"
193-
* - style - an object with one property, called `element` which value
194-
* represents the style which have to be applied to the element.
191+
* Returns an array of colors. Each color consists of two properties:
192+
* - name - The style name, for example "default".
193+
* - style - An object with one property, called `element` which value
194+
* represents the style which have to be applied to the element.
195+
* - styleFn - The function that is invoked to apply the style to the element.
195196
*
196197
* @instance
197198
* @memberof ButtonColor

0 commit comments

Comments
 (0)