React · Senior · Question 55 of 75
What does the React Compiler need from your code to optimize it safely?
- ✓Correct answer: Components and hooks that follow the Rules of React: pure render, no mutation of props/state, rules of hooks
- 2Every component wrapped in
memomanually - 3Class components only
Explanation
When it detects rule violations it skips that component instead of risking bugs. The "use no memo" directive opts a component out temporarily.