Remove toString of dangerouslySetInnerHTML (#17773)
As far as I can tell, the toString call was added here: https://github.com/facebook/react/commit/caae627cd557812d28d11237b34bff6c661ea8bc#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.
Sebastian Markbåge committed
Jan 4, 2020 at 05:47 UTC
edeea0720791f998b505f2ecdcf866c7e539e7a2
1 file changed
+1
-5
packages/react-dom/src/client/ReactDOMComponent.js
+1
-5
@@ -85,7 +85,6 @@ import possibleStandardNames from '../shared/possibleStandardNames';
85
import {validateProperties as validateARIAProperties} from '../shared/ReactDOMInvalidARIAHook';
86
import {validateProperties as validateInputProperties} from '../shared/ReactDOMNullInputValuePropHook';
87
import {validateProperties as validateUnknownProperties} from '../shared/ReactDOMUnknownPropertyHook';
88
-import {toStringOrTrustedType} from './ToStringValue';
88
89
import {
90
enableDeprecatedFlareAPI,
@@ -787,10 +786,7 @@ export function diffProperties(
786
const lastHtml = lastProp ? lastProp[HTML] : undefined;
787
if (nextHtml != null) {
788
if (lastHtml !== nextHtml) {
790
- (updatePayload = updatePayload || []).push(
791
- propKey,
792
- toStringOrTrustedType(nextHtml),
793
- );
789
+ (updatePayload = updatePayload || []).push(propKey, nextHtml);
790
}
791
} else {
792
// TODO: It might be too late to clear this if we have children