News for hackers. Stuff that matters.
Re:React best practices by pigcat on Monday May 03, 2021 @05:51PM (#27031223)
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.

Re:React best practices by cam-perry on Monday May 03, 2021 @05:56PM (#27031280)
Agreed, 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 />.