exhaustive-deps-allow-nonreactive-stable-types-as-extra-deps.js — react Source File
Architecture documentation for exhaustive-deps-allow-nonreactive-stable-types-as-extra-deps.js, a javascript file in the react codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 2c6b770c_4425_9fc8_593e_4c9a545682b3["exhaustive-deps-allow-nonreactive-stable-types-as-extra-deps.js"] ac587885_e294_a1e9_b13f_5e7b920fdb42["react"] 2c6b770c_4425_9fc8_593e_4c9a545682b3 --> ac587885_e294_a1e9_b13f_5e7b920fdb42 style 2c6b770c_4425_9fc8_593e_4c9a545682b3 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
// @validateExhaustiveMemoizationDependencies @validateExhaustiveEffectDependencies:"all"
import {
useCallback,
useTransition,
useState,
useOptimistic,
useActionState,
useRef,
useReducer,
useEffect,
} from 'react';
function useFoo() {
const [s, setState] = useState();
const ref = useRef(null);
const [t, startTransition] = useTransition();
const [u, addOptimistic] = useOptimistic();
const [v, dispatch] = useReducer(() => {}, null);
const [isPending, dispatchAction] = useActionState(() => {}, null);
useEffect(() => {
dispatch();
startTransition(() => {});
addOptimistic();
setState(null);
dispatchAction();
ref.current = true;
}, [
// intentionally adding unnecessary deps on nonreactive stable values
// to check that they're allowed
dispatch,
startTransition,
addOptimistic,
setState,
dispatchAction,
ref,
]);
return useCallback(() => {
dispatch();
startTransition(() => {});
addOptimistic();
setState(null);
dispatchAction();
ref.current = true;
}, [
// intentionally adding unnecessary deps on nonreactive stable values
// to check that they're allowed
dispatch,
startTransition,
addOptimistic,
setState,
dispatchAction,
ref,
]);
}
export const FIXTURE_ENTRYPOINT = {
fn: useFoo,
params: [],
};
Domain
Subdomains
Functions
Dependencies
- react
Source
Frequently Asked Questions
What does exhaustive-deps-allow-nonreactive-stable-types-as-extra-deps.js do?
exhaustive-deps-allow-nonreactive-stable-types-as-extra-deps.js is a source file in the react codebase, written in javascript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in exhaustive-deps-allow-nonreactive-stable-types-as-extra-deps.js?
exhaustive-deps-allow-nonreactive-stable-types-as-extra-deps.js defines 1 function(s): useFoo.
What does exhaustive-deps-allow-nonreactive-stable-types-as-extra-deps.js depend on?
exhaustive-deps-allow-nonreactive-stable-types-as-extra-deps.js imports 1 module(s): react.
Where is exhaustive-deps-allow-nonreactive-stable-types-as-extra-deps.js in the architecture?
exhaustive-deps-allow-nonreactive-stable-types-as-extra-deps.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/exhaustive-deps/exhaustive-deps-allow-nonreactive-stable-types-as-extra-deps.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/exhaustive-deps).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free