`ButtonGroup` ignores nested `Button`s
Describe the bug
ButtonGroup prop-drills its immediate children, assuming they are Buttons. Thus, something like this:
<Button.Group>
<div className="w-10">
<Button color="gray">Profile</Button>
</div>
<div className="w-10">
<Button color="gray">Settings</Button>
</div>
<div className="w-10">
<Button color="gray">Messages</Button>
</div>
</Button.Group>
Does not work like expected.
To Reproduce Steps to reproduce the behavior:
- Add the above snippet to a
flowbite-reactproject - Observe that the buttons are not grouped together, since props (namely,
positionInGroup) aren't being passed
Expected behavior
We should be able to put any HTML inside a Button.Group. Obviously, as long as there's a few Buttons in there.
This wasn't necessary before FlowbiteTheme, but now, in order to customize Buttons, you sometimes need to wrap them in a <div>. That behavior should be supported by ButtonGroups.
We can switch to context, but I don't think there's any way to keep track of the order of the buttons by doing that. So what might be necessary is to prop-drill until we find Buttons, specifically, rather than regular HTML elements.