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

Function checkFormFieldValueStringCoercion

packages/shared/CheckStringCoercion.js:168–180  ·  view source on GitHub ↗
(value: mixed)

Source from the content-addressed store, hash-verified

166}
167
168export function checkFormFieldValueStringCoercion(value: mixed): void | string {
169 if (__DEV__) {
170 if (willCoercionThrow(value)) {
171 console.error(
172 'Form field values (value, checked, defaultValue, or defaultChecked props)' +
173 ' must be strings, not %s.' +
174 ' This value must be coerced to a string before using it here.',
175 typeName(value),
176 );
177 return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
178 }
179 }
180}

Callers 3

getToStringValueFunction · 0.90
trackValueOnNodeFunction · 0.90
setValueFunction · 0.90

Calls 4

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

Tested by

no test coverage detected