cosmos
cosmos copied to clipboard
List.Item cannot be wrapped without spreading props
Describe the bug
Currently, there is no way to wrap List.Item
in another component without spreading props through due to List
mapping over children and cloning the child and adding arrowIsVisible
.
example:
const WrappedItem = () => <List.Item />
const list = (
<List>
<WrappedItem />
</List>
)
Expected behavior
The component can be wrapped and arrowIsVisible
is available to List.Item
. This can be acheived using React context instead of cloning children and adding props.
Additional context Add any other context about the problem here.