error.invalid-mutate-global-in-render-helper-prop.js — react Source File
Architecture documentation for error.invalid-mutate-global-in-render-helper-prop.js, a javascript file in the react codebase.
Entity Profile
Relationship Graph
Source Code
function Component() {
const renderItem = item => {
// Normally we assume that it's safe to mutate globals in a function passed
// as a prop, because the prop could be used as an event handler or effect.
// But if the function returns JSX we can assume it's a render helper, ie
// called during render, and thus it's unsafe to mutate globals or call
// other impure code.
global.property = true;
return <Item item={item} value={rand} />;
};
return <ItemList renderItem={renderItem} />;
}
Domain
Subdomains
Functions
Source
Frequently Asked Questions
What does error.invalid-mutate-global-in-render-helper-prop.js do?
error.invalid-mutate-global-in-render-helper-prop.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-mutate-global-in-render-helper-prop.js?
error.invalid-mutate-global-in-render-helper-prop.js defines 1 function(s): Component.
Where is error.invalid-mutate-global-in-render-helper-prop.js in the architecture?
error.invalid-mutate-global-in-render-helper-prop.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-mutate-global-in-render-helper-prop.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