MCPcopy
hub / github.com/facebook/react / checkHtmlStringCoercion

Function checkHtmlStringCoercion

packages/shared/CheckStringCoercion.js:155–166  ·  view source on GitHub ↗
(value: mixed)

Source from the content-addressed store, hash-verified

153}
154
155export function checkHtmlStringCoercion(value: mixed): void | string {
156 if (__DEV__) {
157 if (willCoercionThrow(value)) {
158 console.error(
159 'The provided HTML markup uses a value of unsupported type %s.' +
160 ' This value must be coerced to a string before using it here.',
161 typeName(value),
162 );
163 return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
164 }
165 }
166}
167
168export function checkFormFieldValueStringCoercion(value: mixed): void | string {
169 if (__DEV__) {

Callers 7

escapeHtmlFunction · 0.90
pushInnerHTMLFunction · 0.90
pushStartTextAreaFunction · 0.90
escapeStyleTextContentFunction · 0.90

Calls 4

willCoercionThrowFunction · 0.85
typeNameFunction · 0.85
testStringCoercionFunction · 0.85
errorMethod · 0.65

Tested by

no test coverage detected