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

Function getToStringValue

packages/react-dom-bindings/src/client/ToStringValue.js:30–47  ·  view source on GitHub ↗
(value: mixed)

Source from the content-addressed store, hash-verified

28}
29
30export function getToStringValue(value: mixed): ToStringValue {
31 switch (typeof value) {
32 case 'bigint':
33 case 'boolean':
34 case 'number':
35 case 'string':
36 case 'undefined':
37 return value;
38 case 'object':
39 if (__DEV__) {
40 checkFormFieldValueStringCoercion(value);
41 }
42 return value;
43 default:
44 // function, symbol are assigned as empty strings
45 return '';
46 }
47}

Callers 8

updateTextareaFunction · 0.90
initTextareaFunction · 0.90
hydrateTextareaFunction · 0.90
updateInputFunction · 0.90
initInputFunction · 0.90
hydrateInputFunction · 0.90
updateOptionsFunction · 0.90
hydrateSelectFunction · 0.90

Calls 1

Tested by

no test coverage detected