ReactDOMInput-test.js — react Source File
Architecture documentation for ReactDOMInput-test.js, a javascript file in the react codebase.
Entity Profile
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.
*
* @emails react-core
*/
'use strict';
// Set by `yarn test-fire`.
const {disableInputAttributeSyncing} = require('shared/ReactFeatureFlags');
function emptyFunction() {}
describe('ReactDOMInput', () => {
let React;
let ReactDOM;
let ReactDOMClient;
let ReactDOMServer;
let Scheduler;
let act;
let assertLog;
let setUntrackedValue;
let setUntrackedChecked;
let container;
let root;
let assertConsoleErrorDev;
function dispatchEventOnNode(node, type) {
node.dispatchEvent(new Event(type, {bubbles: true, cancelable: true}));
}
function isValueDirty(node) {
// Return the "dirty value flag" as defined in the HTML spec. Cast to text
// input to sidestep complicated value sanitization behaviors.
const copy = node.cloneNode();
copy.type = 'text';
// If modifying the attribute now doesn't change the value, the value was already detached.
copy.defaultValue += Math.random();
return copy.value === node.value;
}
function isCheckedDirty(node) {
// Return the "dirty checked flag" as defined in the HTML spec.
if (node.checked !== node.defaultChecked) {
return true;
}
const copy = node.cloneNode();
copy.type = 'checkbox';
copy.defaultChecked = !copy.defaultChecked;
return copy.checked === node.checked;
}
function getTrackedAndCurrentInputValue(elem: HTMLElement): [mixed, mixed] {
const tracker = elem._valueTracker;
if (!tracker) {
throw new Error('No input tracker');
}
// ... (3053 more lines)
Domain
Subdomains
Functions
Source
Frequently Asked Questions
What does ReactDOMInput-test.js do?
ReactDOMInput-test.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 ReactDOMInput-test.js?
ReactDOMInput-test.js defines 1 function(s): emptyFunction.
Where is ReactDOMInput-test.js in the architecture?
ReactDOMInput-test.js is located at packages/react-dom/src/__tests__/ReactDOMInput-test.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-dom/src/__tests__).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free