ReactDOMSelect.js — react Source File
Architecture documentation for ReactDOMSelect.js, a javascript file in the react codebase. 6 imports, 2 dependents.
Entity Profile
Dependency Diagram
graph LR 45a4825c_28bb_dfd1_ecd2_0adf3836cafc["ReactDOMSelect.js"] 737f4a11_a501_8e28_d675_7c1b8ca71848["ToStringValue.js"] 45a4825c_28bb_dfd1_ecd2_0adf3836cafc --> 737f4a11_a501_8e28_d675_7c1b8ca71848 7404ee30_0cd4_7886_2806_324f301962c4["getToStringValue"] 45a4825c_28bb_dfd1_ecd2_0adf3836cafc --> 7404ee30_0cd4_7886_2806_324f301962c4 14e1dad9_019e_0b6b_45f9_989dc6db3084["toString"] 45a4825c_28bb_dfd1_ecd2_0adf3836cafc --> 14e1dad9_019e_0b6b_45f9_989dc6db3084 2d4946a3_3487_598a_390d_fcf4897abb9b["ReactDOMEventReplaying.js"] 45a4825c_28bb_dfd1_ecd2_0adf3836cafc --> 2d4946a3_3487_598a_390d_fcf4897abb9b 9a7dedff_ebb2_a1a9_a4c3_be4ea69f001e["ReactCurrentFiber"] 45a4825c_28bb_dfd1_ecd2_0adf3836cafc --> 9a7dedff_ebb2_a1a9_a4c3_be4ea69f001e af78c51d_c7cb_3bf4_550f_f3fcc48f4f34["isArray"] 45a4825c_28bb_dfd1_ecd2_0adf3836cafc --> af78c51d_c7cb_3bf4_550f_f3fcc48f4f34 1e990658_7cea_75be_1f24_2399bdf9f15b["ReactDOMComponent.js"] 1e990658_7cea_75be_1f24_2399bdf9f15b --> 45a4825c_28bb_dfd1_ecd2_0adf3836cafc 9c694103_7f39_88d0_6b4d_f9b2ffed5731["ReactFiberConfigDOM.js"] 9c694103_7f39_88d0_6b4d_f9b2ffed5731 --> 45a4825c_28bb_dfd1_ecd2_0adf3836cafc style 45a4825c_28bb_dfd1_ecd2_0adf3836cafc fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
// TODO: direct imports like some-package/src/* are bad. Fix me.
import {getCurrentFiberOwnerNameInDevOrNull} from 'react-reconciler/src/ReactCurrentFiber';
import {getToStringValue, toString} from './ToStringValue';
import isArray from 'shared/isArray';
import {queueChangeEvent} from '../events/ReactDOMEventReplaying';
let didWarnValueDefaultValue;
if (__DEV__) {
didWarnValueDefaultValue = false;
}
function getDeclarationErrorAddendum() {
const ownerName = getCurrentFiberOwnerNameInDevOrNull();
if (ownerName) {
return '\n\nCheck the render method of `' + ownerName + '`.';
}
return '';
}
const valuePropNames = ['value', 'defaultValue'];
/**
* Validation function for `value` and `defaultValue`.
*/
function checkSelectPropTypes(props: any) {
if (__DEV__) {
for (let i = 0; i < valuePropNames.length; i++) {
const propName = valuePropNames[i];
if (props[propName] == null) {
continue;
}
const propNameIsArray = isArray(props[propName]);
if (props.multiple && !propNameIsArray) {
console.error(
'The `%s` prop supplied to <select> must be an array if ' +
'`multiple` is true.%s',
propName,
getDeclarationErrorAddendum(),
);
} else if (!props.multiple && propNameIsArray) {
console.error(
'The `%s` prop supplied to <select> must be a scalar ' +
'value if `multiple` is false.%s',
propName,
getDeclarationErrorAddendum(),
);
}
}
}
// ... (184 more lines)
Domain
Subdomains
Functions
Dependencies
- ReactCurrentFiber
- ReactDOMEventReplaying.js
- ToStringValue.js
- getToStringValue
- isArray
- toString
Imported By
Source
Frequently Asked Questions
What does ReactDOMSelect.js do?
ReactDOMSelect.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in ReactDOMSelect.js?
ReactDOMSelect.js defines 8 function(s): checkSelectPropTypes, getDeclarationErrorAddendum, hydrateSelect, initSelect, restoreControlledSelectState, updateOptions, updateSelect, validateSelectProps.
What does ReactDOMSelect.js depend on?
ReactDOMSelect.js imports 6 module(s): ReactCurrentFiber, ReactDOMEventReplaying.js, ToStringValue.js, getToStringValue, isArray, toString.
What files import ReactDOMSelect.js?
ReactDOMSelect.js is imported by 2 file(s): ReactDOMComponent.js, ReactFiberConfigDOM.js.
Where is ReactDOMSelect.js in the architecture?
ReactDOMSelect.js is located at packages/react-dom-bindings/src/client/ReactDOMSelect.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-dom-bindings/src/client).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free