inputValueTracking.js — react Source File
Architecture documentation for inputValueTracking.js, a javascript file in the react codebase. 1 imports, 3 dependents.
Entity Profile
Dependency Diagram
graph LR 87cb1bb7_ad8f_2954_9806_14348a9bbec3["inputValueTracking.js"] 0ae63ebd_b26a_05c8_1c6d_275a5f6b76c7["CheckStringCoercion"] 87cb1bb7_ad8f_2954_9806_14348a9bbec3 --> 0ae63ebd_b26a_05c8_1c6d_275a5f6b76c7 ebd36fdb_cc70_52b6_9971_bcace1958602["ReactDOMInput.js"] ebd36fdb_cc70_52b6_9971_bcace1958602 --> 87cb1bb7_ad8f_2954_9806_14348a9bbec3 8997a27a_fcfe_cfbe_fe0c_b8a92dc76e38["ReactDOMTextarea.js"] 8997a27a_fcfe_cfbe_fe0c_b8a92dc76e38 --> 87cb1bb7_ad8f_2954_9806_14348a9bbec3 ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7["ChangeEventPlugin.js"] ddc0fe5b_559e_c0f1_b50a_2b1305b3c3d7 --> 87cb1bb7_ad8f_2954_9806_14348a9bbec3 style 87cb1bb7_ad8f_2954_9806_14348a9bbec3 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
*/
import {checkFormFieldValueStringCoercion} from 'shared/CheckStringCoercion';
type ValueTracker = {
getValue(): string,
setValue(value: string): void,
stopTracking(): void,
};
interface ElementWithValueTracker extends HTMLInputElement {
_valueTracker?: ?ValueTracker;
}
function isCheckable(elem: HTMLInputElement) {
const type = elem.type;
const nodeName = elem.nodeName;
return (
nodeName &&
nodeName.toLowerCase() === 'input' &&
(type === 'checkbox' || type === 'radio')
);
}
function getTracker(node: ElementWithValueTracker) {
return node._valueTracker;
}
function detachTracker(node: ElementWithValueTracker) {
node._valueTracker = null;
}
function getValueFromNode(node: HTMLInputElement): string {
let value = '';
if (!node) {
return value;
}
if (isCheckable(node)) {
value = node.checked ? 'true' : 'false';
} else {
value = node.value;
}
return value;
}
function trackValueOnNode(
node: any,
valueField: 'checked' | 'value',
currentValue: string,
): ?ValueTracker {
const descriptor = Object.getOwnPropertyDescriptor(
node.constructor.prototype,
// ... (129 more lines)
Domain
Subdomains
Functions
Dependencies
- CheckStringCoercion
Imported By
Source
Frequently Asked Questions
What does inputValueTracking.js do?
inputValueTracking.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 inputValueTracking.js?
inputValueTracking.js defines 8 function(s): _valueTracker, stopTracking, track, trackHydrated, tracker.getValue, tracker.setValue, tracker.stopTracking, updateValueIfChanged.
What does inputValueTracking.js depend on?
inputValueTracking.js imports 1 module(s): CheckStringCoercion.
What files import inputValueTracking.js?
inputValueTracking.js is imported by 3 file(s): ChangeEventPlugin.js, ReactDOMInput.js, ReactDOMTextarea.js.
Where is inputValueTracking.js in the architecture?
inputValueTracking.js is located at packages/react-dom-bindings/src/client/inputValueTracking.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