Skip to content

Instantly share code, notes, and snippets.

View ovieokeh's full-sized avatar
🏠
Working from home

Ovie Okeh ovieokeh

🏠
Working from home
View GitHub Profile
@ovieokeh
ovieokeh / intro.md
Last active November 23, 2020 08:20
Experimental idea for state management using Context API + Hooks

react-state-context is a small library for managing context state in an imperative and predictable way for small to mid-sized react apps.

These days, you don't have to install a library to manage your react state. Thanks to the Context API and the useReducer hook, you can manage your state cleanly without having to rely on prop drilling. This is great but only if you do it right. Without the structure provided by a dedicated state management library, you may find it difficult to structure and manage your state in a predictive way (think having tons of dispatch actions spread around your codebase without clarity on what each dispatch does).