act() — react Function Reference
Architecture documentation for the act() function in ReactTestUtils.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD c313eb75_f501_939b_c634_89cd7aa2fdc5["act()"] 7e8f04a0_dc70_8175_071e_addcb82a94d6["ReactTestUtils.js"] c313eb75_f501_939b_c634_89cd7aa2fdc5 -->|defined in| 7e8f04a0_dc70_8175_071e_addcb82a94d6 style c313eb75_f501_939b_c634_89cd7aa2fdc5 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-dom/src/test-utils/ReactTestUtils.js lines 13–23
export function act(callback) {
if (didWarnAboutUsingAct === false) {
didWarnAboutUsingAct = true;
console.error(
'`ReactDOMTestUtils.act` is deprecated in favor of `React.act`. ' +
'Import `act` from `react` instead of `react-dom/test-utils`. ' +
'See https://react.dev/warnings/react-dom-test-utils for more info.',
);
}
return React.act(callback);
}
Domain
Subdomains
Source
Frequently Asked Questions
What does act() do?
act() is a function in the react codebase, defined in packages/react-dom/src/test-utils/ReactTestUtils.js.
Where is act() defined?
act() is defined in packages/react-dom/src/test-utils/ReactTestUtils.js at line 13.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free