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(DropdownToggle): fix 0 value #1496 #1780

Merged
merged 3 commits into from Jun 22, 2020
Merged

fix(DropdownToggle): fix 0 value #1496 #1780

merged 3 commits into from Jun 22, 2020

Conversation

hedgecox
Copy link
Contributor

@hedgecox hedgecox commented Feb 4, 2020

  • Bug fix
  • New feature
  • Chore
  • Breaking change
  • There is an open issue which this change addresses
  • I have read the CONTRIBUTING document.
  • My commits follow the Git Commit Guidelines
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Replaced OR operator with null-coalescing operator to allow 0 value but not nullish values

#1496

@hedgecox
Copy link
Contributor Author

hedgecox commented Feb 4, 2020

Just seen the travis SyntaxError:
"Support for the experimental syntax 'nullishCoalescingOperator' isn't currently enabled (63:37)"

Will close this for now

@hedgecox hedgecox closed this Feb 4, 2020
@hedgecox
Copy link
Contributor Author

hedgecox commented Feb 4, 2020

Looking at the support it seems even though it's not fully supported in the browsers there is support for it in Babel: babel/proposals#14

Babel transpiles it as so:
const b = a ?? "else";
to
const b = a !== null && a !== void 0 ? a : "else";

However, this might be overkill for the problem at hand

@hedgecox hedgecox reopened this Feb 4, 2020
@TheSharpieOne TheSharpieOne changed the title bug(DropdownToggle): fix 0 value #1496 fix(DropdownToggle): fix 0 value #1496 Jun 22, 2020
@TheSharpieOne TheSharpieOne merged commit c4f86d5 into reactstrap:master Jun 22, 2020
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.

None yet

2 participants