Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize Shuffle Code and Eliminate Prop Drilling with Context API #1426

Open
LalitDeore opened this issue Jun 15, 2024 · 0 comments
Open

Optimize Shuffle Code and Eliminate Prop Drilling with Context API #1426

LalitDeore opened this issue Jun 15, 2024 · 0 comments
Assignees

Comments

@LalitDeore
Copy link
Contributor

LalitDeore commented Jun 15, 2024

Is your feature request related to a problem? Please describe.

Currently, props are passed through the hierarchy of components even when a component doesn't need them but its child does. This leads to unnecessary prop drilling and results in the loss of many props when the page is refreshed

Describe the solution you'd like

To address the issue of unnecessary prop drilling, the proposed solution is to use the Context API. By implementing the Context API, we can provide data directly to the components that need it, bypassing intermediate components that don't require the props.

Additional context

Create a separate file for the Context API and use it to pass all global states from App.js to child components through the Context API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant