Making small button components for each button w/ separate logic. Each manages its own logic & will appear when appropriate & can be moved around and added without having to rewire a parent component.
My largest motivation for doing this is we've learned as the codebase has grown and changed that the best way to minimize buggy refactors and minimize the time it takes to do refactors is to minimize duplicate code & try to make any component with complicated logic be responsible for itself. By having a button for each action, the buttons themselves can be responsible for ensure they appear at the right time, and not having to have a parent component that figures out the complicated logic for showing or hiding each button. And again, as I mentioned above, this also means that if the buttons need to move around we don't have to do large refactors to move them.
Making small button components for each button w/ separate logic. Each manages its own logic & will appear when appropriate & can be moved around and added without having to rewire a parent component.
My largest motivation for doing this is we've learned as the codebase has grown and changed that the best way to minimize buggy refactors and minimize the time it takes to do refactors is to minimize duplicate code & try to make any component with complicated logic be responsible for itself. By having a button for each action, the buttons themselves can be responsible for ensure they appear at the right time, and not having to have a parent component that figures out the complicated logic for showing or hiding each button. And again, as I mentioned above, this also means that if the buttons need to move around we don't have to do large refactors to move them.