Skip to content

Conditional Button in a Button.Group breaks application #900

@emre88tosun

Description

@emre88tosun
  • I have searched the Issues to see if this bug has already been reported
  • I have tested the latest version

Steps to reproduce

  1. Add a conditional Button in a Button.Group

<Button.Group> <Button>Not conditional</Button> { someCondition && <Button>Conditional</Button> } </Button.Group>

Current behavior

When a conditional Button is added in a Button.Group it throws

Uncaught Error: React.cloneElement(...): The argument must be a React element, but you passed null. at Object.cloneElement (react.development.js:879:11) at Object.cloneElementWithValidation (react.development.js:2413:33) at React2.cloneElement (whyDidYouRender.js:283:48) at ButtonGroup.js:7:74 at react.development.js:1158:17 at mapIntoArray (react.development.js:1049:23) at mapIntoArray (react.development.js:1099:23) at Object.mapChildren [as map] (react.development.js:1157:3) at ButtonGroup.js:7:42 at mountMemo (react-dom.development.js:17225:19)

Expected behavior

It just should or not render the conditional button

Context

Trying to add just some conditional buttons in a button group

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't workingconfirmedThis bug was confirmedhelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions