MCPcopy Index your code
hub / github.com/react/react / checkSelectProp

Function checkSelectProp

packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js:1897–1917  ·  view source on GitHub ↗
(props: any, propName: string)

Source from the content-addressed store, hash-verified

1895let didWarnFormActionMethod = false;
1896
1897function checkSelectProp(props: any, propName: string) {
1898 if (__DEV__) {
1899 const value = props[propName];
1900 if (value != null) {
1901 const array = isArray(value);
1902 if (props.multiple && !array) {
1903 console.error(
1904 'The `%s` prop supplied to <select> must be an array if ' +
1905 '`multiple` is true.',
1906 propName,
1907 );
1908 } else if (!props.multiple && array) {
1909 console.error(
1910 'The `%s` prop supplied to <select> must be a scalar ' +
1911 'value if `multiple` is false.',
1912 propName,
1913 );
1914 }
1915 }
1916 }
1917}
1918
1919function pushStartAnchor(
1920 target: Array<Chunk | PrecomputedChunk>,

Callers 1

pushStartSelectFunction · 0.85

Calls 2

isArrayFunction · 0.85
errorMethod · 0.65

Tested by

no test coverage detected