-
-
Notifications
You must be signed in to change notification settings - Fork 122
Unpossible to use React condition #12
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
Comments
Can you give more details? I don't get the point here... |
Updated. Added like a code this time. Please, look on it one more time. |
if the condition is false with the following structure If you want to render a separator or an item depending on the condition a ternary is what you are looking for. This has nothing to do with the component, it's pure javascript in that case. If I miss something please tell me. |
Yes. Your code works. But I would like just if condition. And it something what I have done. {condition && && } it will always be false. And problem that it produce error. |
Like Inline If with Logical && Operator here https://facebook.github.io/react/docs/conditional-rendering.html |
Ok I start to understand now 😁 . If your condition is true you want to render both the |
In that case : |
If i do the following : Snippet here : codepen. Can you provide a pen ? |
Yes. You are right about true condition |
What you need to do is : So in your case, it will be easier if you do because you can't group the separator and the item :
snippet : codepen |
And my expectation is not see separator it item if conditions will be false, without any error |
Can you send me the full snippet so I can reproduce the issue ? |
Sorry for late answer. Not sure how I can add this plugin to codepen. At least, code for reproducing you can find below.
|
If you can explain me how to add library to codepen - I will add a snippet |
@brezetsky the code is enough thanks. I'll check it when I'm home. |
Hey, in the next release this |
Thanks. |
@brezetsky new release published. I still need to update the demo |
@fkhadra problem still appear |
@brezetsky you updated to the last version ? |
Sure. |
@brezetsky new fix inc is few minutes. My test case was bad ! |
Thanks. |
Uh oh!
There was an error while loading. Please reload this page.
next structure doesn't work in case of condition is false
{condition && <Separator/> && <Item label="label" disabled/>}
The text was updated successfully, but these errors were encountered: