-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve dismissItem
behaviour in SiwG.
#10095
Conversation
Build files for 4f9637c have been deleted. |
Size Change: +123 B (+0.01%) Total Size: 1.99 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tofumatt looks good. I just have one question
@@ -119,6 +122,7 @@ SettingsNotice.propTypes = { | |||
LearnMore: PropTypes.elementType, | |||
CTA: PropTypes.elementType, | |||
OuterCTA: PropTypes.elementType, | |||
dismiss: PropTypes.oneOfType( [ PropTypes.string, PropTypes.bool ] ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering why are we allowing dismiss
to be a boolean as well? As the only intended type for this prop is supposed to be the string, and default value is already set to the empty string if prop is not passed - the logic won't work with boolean value anyway (if we pass true
for example, no dismissal will happen, but we will not get error until we attempt to dismiss it when invariant
in the action will throw an error)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct! This was here before when I was testing things out, it can/should just be string now. I've updated it, thanks 😀
Thanks @tofumatt LGTM |
Summary
Addresses issue:
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist