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
0 value not displaying in DropdownToggle #1496
Comments
Probably due to reactstrap/src/DropdownToggle.js Line 63 in c844ab1
For now, you can just use |
Thanks. I settled on |
Closing as fixed |
This was referenced Mar 29, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DropdownToggle
#8.0.0
umd/csj/es
es#16.8.6
#4.0.0
What is happening?
I'm passing props to a custom component that sometimes has the value of 0. The render in my custom file looks like this:
When the value of
currentMinute=0
the display shows this:(In the yellow box the 0 comes from the parent file.)
What should be happening?
0 should be displayed as a value just like the other values (
Steps to reproduce issue
It appears that reactstrap is treating this 0 as a boolean value. If I change the code to display based on an if/else
{this.props.currentMinute === 0 ? '0' : this.props.currentHour}
it does display properly.Interestingly, it seems if I put any other code as a child here it does render properly. For example,
{this.props.currentMinute}{'anything else'}
will show0anything else
.Error message in console
Code
https://stackblitz.com/edit/react-7zzcjw
The text was updated successfully, but these errors were encountered: