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

Function checkCSSPropertyStringCoercion

packages/shared/CheckStringCoercion.js:138–153  ·  view source on GitHub ↗
(
  value: mixed,
  propName: string,
)

Source from the content-addressed store, hash-verified

136}
137
138export function checkCSSPropertyStringCoercion(
139 value: mixed,
140 propName: string,
141): void | string {
142 if (__DEV__) {
143 if (willCoercionThrow(value)) {
144 console.error(
145 'The provided `%s` CSS property is an unsupported type %s.' +
146 ' This value must be coerced to a string before using it here.',
147 propName,
148 typeName(value),
149 );
150 return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
151 }
152 }
153}
154
155export function checkHtmlStringCoercion(value: mixed): void | string {
156 if (__DEV__) {

Callers 3

setValueForStyleFunction · 0.90
pushStyleAttributeFunction · 0.90

Calls 4

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

Tested by

no test coverage detected