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

Function checkPropStringCoercion

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

Source from the content-addressed store, hash-verified

102}
103
104export function checkPropStringCoercion(
105 value: mixed,
106 propName: string,
107): void | string {
108 if (__DEV__) {
109 if (willCoercionThrow(value)) {
110 console.error(
111 'The provided `%s` prop is an unsupported type %s.' +
112 ' This value must be coerced to a string before using it here.',
113 propName,
114 typeName(value),
115 );
116 return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
117 }
118 }
119}
120
121export function checkOptionStringCoercion(
122 value: mixed,

Callers 4

cloneInstanceFunction · 0.90
createInstanceFunction · 0.90
commitUpdateFunction · 0.90
getChildrenFunction · 0.90

Calls 4

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

Tested by

no test coverage detected