Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update BackupNowButton propTypes to include new variant options
Changed the variant prop in the BackupNowButton component from 'primary', 'secondary', 'tertiary' to 'solid', 'outline', 'minimal', 'unstyled' for improved flexibility in button styling.
  • Loading branch information
DevinWalker committed Mar 3, 2026
commit 10b8090fd230d411e399272222ae41e23b1ceb04
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ BackupNowButton.propTypes = {
children: PropTypes.node,
tooltipText: PropTypes.string,
tracksEventName: PropTypes.string,
variant: PropTypes.oneOf( [ 'primary', 'secondary', 'tertiary' ] ),
variant: PropTypes.oneOf( [ 'solid', 'outline', 'minimal', 'unstyled' ] ),
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variant PropTypes were changed to [ 'solid', 'outline', 'minimal', 'unstyled' ], but other code in this package already passes variant="primary" / variant="tertiary" to buttons. This will produce PropTypes warnings and suggests the accepted values don't match actual usage. Either expand the allowed values to include the variants you use in this repo, or update the callers and confirm the WP Button variant API supports the new set.

Suggested change
variant: PropTypes.oneOf( [ 'solid', 'outline', 'minimal', 'unstyled' ] ),
variant: PropTypes.oneOf( [ 'solid', 'outline', 'minimal', 'unstyled', 'primary', 'tertiary' ] ),

Copilot uses AI. Check for mistakes.
onClick: PropTypes.func,
};
Comment on lines 106 to 112
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PropTypes for variant no longer include values that are actually passed by consumers (e.g., "primary"), and the listed values ("solid", "outline", etc.) don’t match the Button variant values used elsewhere with @wordpress/components in this repo. Update the allowed variants to match @wordpress/components (and current usage) so runtime warnings don’t occur.

Copilot uses AI. Check for mistakes.

Expand Down
Loading