-
Notifications
You must be signed in to change notification settings - Fork 47.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fragment under boolean condition leads to crashes #17218
Comments
Please share a reproducing example? You could use codesandbox, or a git repo. |
I would love to give you more information, but like I mentioned before, as of now don't have a reproducible example. Sorry. |
I can't reproduce this error. Here's a simplified version of what you shared https://codesandbox.io/s/nostalgic-jennings-inwhd Observe that it works as expected. My guess is that you have something else on your page that's interfering with the page, possibly a browser extension. It's also possible that I'm going to close this issue, but I'd be happy to discuss/reopen if there's more information provided. |
It's boolean for sure. Also not sure what kind of content inside would be replaced by browser extension. What was a bit suspicious for me was |
I don't think so, but if it's a bug, I wouldn't know haha. |
I had the same problem deactivating translator, I solve my error |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Having such code sample inside render's return block
Results in error of a kind
About 1% of users of an application were affected by this, however, I myself was not able to reproduce it. From a component error stack I was able to track-down where possibly can be an issue. Replacing
{booleanVariable && ...}
with ternary{booleanVariable ? ... : null}
resolved the problem and our users are not facing it anymore.What is the expected behavior?
React not throwing error. Maybe warning? Not rendering that particular part? But not crashing the whole application.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
It crashed with react version
16.9.0
, other versions were not tested. Users that were affected have Windows 7+, Mac OS 10.13+ and Chrome 77+.The text was updated successfully, but these errors were encountered: