Steps to Create Project
Step 1: Create React application:
npx create-react-app my-app
Step 2: Navigate to the root folder by using the command:
cd my-app
Step 3: Create two files ChildA.js and ChildB.js in the src folder as shown
How to use the Context API to avoid prop drilling?
This article demonstrates the use of Context API to avoid prop drilling in React. We will learn about the following concepts:
Table of Content
- What are Props ?
- What is Prop Drilling ?
- Context API
- Use the Context API to Avoid Prop drilling
Contact Us