
ALT // These types are for a reusable Button footer renders some buttons, with an optional back button. type ButtonFooterProps = { // Avoid. These 2 optional props are related, but the API allows providing only one. // It doesn't make it clear that both are required if one is provided. 👎 // Tip: Repeating the words "backButton" in // each prop is a sign they're related, and thus, should be unified. backButtonLabel? = string; backButtonOnClick?: (e) => void; // Other props here... } type ButtonFooterProps = { // Much better. Now, if you want to specify a back button, you must provide both props. // And the repeated "backButton" name on each property is eliminated. 👍 backButton?: { label = string; onClick: (e) => void; } // Other props here... }















