-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Could dangerouslySetInnerHTML.__html
be null
or undefined
?
#3460
Comments
Someone else mentioned this being surprising to me too. |
I've been experiencing the same issues recently |
As far as I understand it, the idea is that |
@syranide That doesn't mean that people won't write it as |
The simplest workaround is to coerce into an empty string with +1 for having React do this internally. |
Got surprised by this today, upgrading from Was it a "bug" in Anyway, will use |
In following JSX fragment I should guarantee that
this.props.description
will never benull
orundefined
:Otherwise https://github.com/facebook/react/blob/master/src/browser/ui/ReactDOMComponent.js#L74 throws an error although construction is correct:
Should
invariant
instead ofprops.dangerouslySetInnerHTML.__html != null
check for'__html' in props.dangerouslySetInnerHTML
?The text was updated successfully, but these errors were encountered: