Skip to content
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

fix(form-v2): add double negation to fix react displaying 0 #4475

Merged
merged 1 commit into from
Aug 3, 2022
Merged

fix(form-v2): add double negation to fix react displaying 0 #4475

merged 1 commit into from
Aug 3, 2022

Conversation

tohhengxing
Copy link
Contributor

Problem

0 displaying in empty form @karrui

Closes #4473

Solution

!!conditional. I didn't know that react will render anything even if it is falsey as long as its not undefined or bool. Sorry!

https://stackoverflow.com/questions/53048037/react-showing-0-instead-of-nothing-with-short-circuit-conditional-component

Breaking Changes

  • No - this PR is backwards compatible

Before & After Screenshots

BEFORE:
look at #4473

AFTER:

image

@tohhengxing tohhengxing changed the title fix: add double negation to fix react displaying 0 fix(form-v2): add double negation to fix react displaying 0 Aug 3, 2022
@karrui karrui merged commit 7d6b00e into opengovsg:form-v2/develop Aug 3, 2022
@justynoh justynoh mentioned this pull request Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants