error.invalid-use-ref-added-to-dep-without-type-info.js — react Source File
Architecture documentation for error.invalid-use-ref-added-to-dep-without-type-info.js, a javascript file in the react codebase.
Entity Profile
Relationship Graph
Source Code
// @validateRefAccessDuringRender
function Foo({a}) {
const ref = useRef();
// type information is lost here as we don't track types of fields
const val = {ref};
// without type info, we don't know that val.ref.current is a ref value so we
// *would* end up depending on val.ref.current
// however, this is an instance of accessing a ref during render and is disallowed
// under React's rules, so we reject this input
const x = {a, val: val.ref.current};
return <VideoList videos={x} />;
}
Domain
Subdomains
Functions
Source
Frequently Asked Questions
What does error.invalid-use-ref-added-to-dep-without-type-info.js do?
error.invalid-use-ref-added-to-dep-without-type-info.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 error.invalid-use-ref-added-to-dep-without-type-info.js?
error.invalid-use-ref-added-to-dep-without-type-info.js defines 1 function(s): Foo.
Where is error.invalid-use-ref-added-to-dep-without-type-info.js in the architecture?
error.invalid-use-ref-added-to-dep-without-type-info.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-use-ref-added-to-dep-without-type-info.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free