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

Function checkAttributeStringCoercion

packages/shared/CheckStringCoercion.js:74–89  ·  view source on GitHub ↗
(
  value: mixed,
  attributeName: string,
)

Source from the content-addressed store, hash-verified

72}
73
74export function checkAttributeStringCoercion(
75 value: mixed,
76 attributeName: string,
77): void | string {
78 if (__DEV__) {
79 if (willCoercionThrow(value)) {
80 console.error(
81 'The provided `%s` attribute is an unsupported type %s.' +
82 ' This value must be coerced to a string before using it here.',
83 attributeName,
84 typeName(value),
85 );
86 return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
87 }
88 }
89}
90
91export function checkKeyStringCoercion(value: mixed): void | string {
92 if (__DEV__) {

Callers 15

canHydrateInstanceFunction · 0.90
hydrateHoistableFunction · 0.90
setPropFunction · 0.90
hydrateAttributeFunction · 0.90
hydrateNumericAttributeFunction · 0.90
getValueForAttributeFunction · 0.90
setValueForAttributeFunction · 0.90

Calls 4

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

Tested by

no test coverage detected