(feature) Something like `context` in React
See original GitHub issueWould it be possible to have something like context
in React?
An object that you could set once on initialisation (in a custom render
function at the top of your app) and then somehow access it later down in the component tree?
It’d be mostly for convenience, since I’m already passing an object (I think you call it data
) down, and get my state from it.
I’d like to build something similar to react-router
to be used with this library.
What do you think? is this even possible? a stupid idea?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Context - React
Context provides a way to share values like these between components without having to explicitly pass a prop through every level of the...
Read more >React Context for Beginners – The Complete Guide (2021)
React context is an essential tool for every React developer to know. It lets you easily share state in your applications.
Read more >How to Work with the React Context API - Toptal
What is context in React? React's context allows you to share information to any component, by storing it in a central place and...
Read more >React Context API: A deep dive with examples - LogRocket Blog
According to the React docs, Context provides a way to pass data through the component tree from parent to child components, without having...
Read more >A Guide to React Context and useContext() Hook
The context is used to manage global data, e.g. global state, theme, services, user settings, and more. In this post, you'll learn how...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I did something that could be it. It’s not something “on top” of picodom as @jbucaran first suggested, but “in it”, here’s a PR #27
It’s so simple that it’s a bit scary, haha. I’d love to know your thoughts.
Closing as wontfix. #27