3 ms·
I can't see any advantage of doing it this way You are already deciding that this component will take one of iconProps/buttonProps/dropdownItemProps, so you've
by pigcat 5y ago
I can't see any advantage of doing it this way
You are already deciding that this component will take one of iconProps/buttonProps/dropdownItemProps, so you've already decided what type of component it is. You might as well just call <Icon />, <Button />, or <Dropdown.Item /> from the parent component and have more readable code.
- cam-perry 5y agoAgreed, I would have a component like <CommentDeleteButton /> render a normal <Button /> by default without these different iconProps/buttonProps/dropdownItemProps. Then give a renderButton prop to override the Button and use whatever <Icon />, <Dropdown.Item /> you want when you are using the <CommentDeleteButton />.