-
Notifications
You must be signed in to change notification settings - Fork 47.1k
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
Remove toString of dangerouslySetInnerHTML #17773
Conversation
As far as I can tell, the toString call was added here: facebook@caae627#diff-5574f655d491348f422bca600ff6711dR887 It was never really needed. Subsequently when we added Trusted Types, this needed to be changed to a special call but we really should just always let it pass through.
3aaed14
to
9b1d183
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 9b1d183:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I added it for consistency with the call to updateTextContent:
this.updateTextContent('' + nextContent); |
As far as I can tell, the toString call was added here:
caae627#diff-5574f655d491348f422bca600ff6711dR887
However, we don't toString the HTML in the initial creation. Only updates. It was never really needed.
Subsequently when we added Trusted Types, this needed to be changed to a special call but we really should just always let it pass through.
Interestingly we should probably always let values pass through except for
when we need to do something special with the string which is rare.