Remove toString of dangerouslySetInnerHTML (#17773)

As far as I can tell, the toString call was added here:

https://github.com/facebook/react/commit/00297a5712eb6e9f64d0b4d677b10d9d344fef21#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.
This commit is contained in:
Sebastian Markbåge
2020-01-04 05:47:23 -08:00
committed by GitHub
parent 7b2d181c55
commit 07024dc3a9
+1 -5
View File
@@ -85,7 +85,6 @@ import possibleStandardNames from '../shared/possibleStandardNames';
import {validateProperties as validateARIAProperties} from '../shared/ReactDOMInvalidARIAHook';
import {validateProperties as validateInputProperties} from '../shared/ReactDOMNullInputValuePropHook';
import {validateProperties as validateUnknownProperties} from '../shared/ReactDOMUnknownPropertyHook';
import {toStringOrTrustedType} from './ToStringValue';
import {
enableDeprecatedFlareAPI,
@@ -787,10 +786,7 @@ export function diffProperties(
const lastHtml = lastProp ? lastProp[HTML] : undefined;
if (nextHtml != null) {
if (lastHtml !== nextHtml) {
(updatePayload = updatePayload || []).push(
propKey,
toStringOrTrustedType(nextHtml),
);
(updatePayload = updatePayload || []).push(propKey, nextHtml);
}
} else {
// TODO: It might be too late to clear this if we have children