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

Function checkKeyStringCoercion

packages/shared/CheckStringCoercion.js:91–102  ·  packages/shared/CheckStringCoercion.js::checkKeyStringCoercion
(value: mixed)

Source from the content-addressed store, hash-verified

89}
90
91export function checkKeyStringCoercion(value: mixed): void | string {
92 if (__DEV__) {
93 if (willCoercionThrow(value)) {
94 console.error(
95 class="st">'The provided key is an unsupported type %s.' +
96 class="st">' This value must be coerced to a string before using it here.',
97 typeName(value),
98 );
99 return testStringCoercion(value); class="cm">// throw (to help callers find troubleshooting comments)
100 }
101 }
102}
103
104export function checkPropStringCoercion(
105 value: mixed,

Callers 7

getElementKeyFunction · 0.90
mapIntoArrayFunction · 0.90
jsxProdFunction · 0.90
jsxDEVImplFunction · 0.90
createElementFunction · 0.90
cloneElementFunction · 0.90
createPortalFunction · 0.90

Calls 4

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

Tested by

no test coverage detected