-
Notifications
You must be signed in to change notification settings - Fork 63
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
Use "undefined" instead of null #48
Comments
In ast.js I changed
to
And all works in hot module reload AND in react tools. Would you consider adding this to the core? Or at least somehow have the possibility to specify which literal can be returned as a "null" literal. [EDIT] Same needs to be updated in choose statement:
|
Ah man, we only just changed to to Returning false appears to be fine according to https://facebook.github.io/react/docs/component-specs.html so I guess we can do it. Weird that Can you make a PR with what you've done? :) |
Returning null should work, as per the spec. If there are situations where null breaks something, that should be fixed upstream. Returning Honestly, I would just close this as "won't fix", and ask people to file bugs on the libraries/tools. jsx-control-statements is completely within spec on this point, afaik. Playing whack-a-mole with bugs in other systems is not a sustainable solution. |
|
Depends if changing it to What @jimfb says makes sense but I think we should at least support a fork until the underlying issue is fixed. |
I'm open to anything, am running from my fork anyways, I only asked if you would consider bringing this into the core. If not, it's perfectly fine and I'll just update from git to latest version when needed. |
Switching to I would really consider doing this, since in my experience such nasty browser bugs get rarely fixed by browser maintainers. |
A fix for this got merged into React master 11 days ago 🎆 |
Hi, when the ternary operator is created with the null
a ? <b/> : null
it creates havoc with some react approaches, such as with hot reloading or with react tools. Is it possible to somehow redefine the structure of the generated ternary statement to useundefined
or use && if no else exists?This seems to work fine:
a ? <b/> : undefined
Examples of problems:
The text was updated successfully, but these errors were encountered: