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

Function checkOptionStringCoercion

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

Source from the content-addressed store, hash-verified

119}
120
121export function checkOptionStringCoercion(
122 value: mixed,
123 propName: string,
124): void | string {
125 if (__DEV__) {
126 if (willCoercionThrow(value)) {
127 console.error(
128 'The provided `%s` option is an unsupported type %s.' +
129 ' This value must be coerced to a string before using it here.',
130 propName,
131 typeName(value),
132 );
133 return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
134 }
135 }
136}
137
138export function checkCSSPropertyStringCoercion(
139 value: mixed,

Calls 4

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

Tested by

no test coverage detected