sindresorhus/ama

Is react-reverse-context a good idea?

eedrah opened this issue ยท 2 comments

Ask you anything you say? ๐Ÿ˜

I had this idea from something I needed in an app (I'm already using it in production to display different sidebars, so I am eating the dog food) - https://github.com/eedrah/react-reverse-context

However, I get suspicious when I feel like this should be a common need, yet I seem to be the only one wanting it... Is this pattern a good one, or have I just completely missed the boat, and there is another design pattern I should be using?

Or, alternatively, where should I go to ask people if they think libraries/react components are well written? I've only just started increasing the amount that I contribute to open source, so I don't know where people hang out.

Also, thanks for being so open to random conversations like AMAs and things like this. I really appreciate reading your thoughts on random things, rather than just seeing those thoughts represented through code.

State management in the React world is in constant flux (pun intended), especially with the introduction of Hooks. My general feeling is that if you need to pass state upwards, it should probably be up there in the first place. For example, if you need some state from a deeply nested component in your top-level component, the state should live in the top-level component or be in a global store.