Skip to content

Commit b813173

Browse files
felipecarreramomastermoo
authored andcommitted
filtering actionButtons to prevent issues with not valid childrens (mastermoo#288)
1 parent e6893e1 commit b813173

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ActionButton.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ export default class ActionButton extends Component {
254254

255255
if (!this.state.active) return null;
256256

257-
const actionButtons = !Array.isArray(children) ? [children] : children;
257+
let actionButtons = !Array.isArray(children) ? [children] : children;
258+
259+
actionButtons = actionButtons.filter( actionButton => (typeof actionButton == 'object') )
258260

259261
const actionStyle = {
260262
flex: 1,
@@ -349,7 +351,7 @@ ActionButton.propTypes = {
349351
]),
350352

351353
renderIcon: PropTypes.func,
352-
354+
353355
bgColor: PropTypes.string,
354356
bgOpacity: PropTypes.number,
355357
buttonColor: PropTypes.string,

0 commit comments

Comments
 (0)