-
-
Notifications
You must be signed in to change notification settings - Fork 730
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
refactor: ts checking conditionallyrender props #7840
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
@@ -55,6 +55,7 @@ export const Error: VFC<IErrorProps> = ({ error }) => { | |||
<ConditionallyRender | |||
condition={showZendeskButton} | |||
show={<ZendeskButton />} | |||
elseShow={undefined} |
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.
I think it's more idiomatic to return null than undefined in react. I checked the code and the ConditionallyRender swaps undefined to null under the hood but in the spirit of "don't make me think" I'd go for null here.
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.
Same for the other places where we follow this pattern
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.
Yes, but in this place prop customButton
expects something || undefined
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.
Ah so it's for the next step of the migration when we do codemods. Those things are worth mentioning in the PR description since it's not obvious.
About the changes
Fix issues found by TS checking after removing ConditionallyRender
Prerequisite for #7825
See https://github.com/Unleash/unleash/actions/runs/10350980657/job/28648500408?pr=7825