Concept: Shallow vs Deep Render
Question
What is shallow rendering in component testing?
Hint
Shallow = one level deep, no children rendered.
Explanation
Shallow rendering renders only the component under test, without recursively rendering its child components. Children appear as stub elements. This isolates the component's logic from its children's behavior. Deep (full) rendering renders the entire component tree. Shallow rendering is less common now — React Testing Library advocates for full rendering to test real behavior.
Related Resources
Related Lessons
- Component Testing
Testing UI components.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.