---
title: "Discussion on \"Handling global state in React without Providers and boilerplate\" | Hashnode"
description: "Discussion on \"Handling global state in React without Providers and boilerplate\". The createStateHook helper function allows a much easier simples way to handle global \"state-like\" values in React."
url: "https://hashnode.com/posts/handling-global-state-in-react-without-providers-and-boilerplate/616163a98e8734462af5f7a8"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Handling global state in React without Providers and boilerplate](https://erikdavtyan.hashnode.dev/handling-global-state-in-react-without-providers-and-boilerplate?utm_source=hashnode&utm_medium=feed)

The createStateHook helper function allows a much easier simples way to handle global "state-like" values in React.

Oct 9, 2021 · 2 min read · erikdavtyan.hashnode.dev  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#reacthooks](https://hashnode.com/tag/reacthooks)

## Written by

[Erik Davtyan](https://hashnode.com/@erikdavtyan)

@erikdavtyan · Yerevan, Armenia

  
[View profile](https://hashnode.com/@erikdavtyan)

Startup Founder | Solutions Architect

Startup Founder | Senior Platform Engineer @ A.Team | Building and Deploying Scalable Web Applications

## Responses 1

Markdown supported · ⌘↵ to post

[Netanel Basal](https://hashnode.com/@jsnetanel)

[Oct 9, 2021](https://hashnode.com/posts/handling-global-state-in-react-without-providers-and-boilerplate/616163a98e8734462af5f7a8/comment/6161c88718374f2573271cbf)

Check out [Elf](https://ngneat.github.io/elf/)

[Erik Davtyan](https://hashnode.com/@erikdavtyan)

[Oct 9, 2021](https://hashnode.com/posts/handling-global-state-in-react-without-providers-and-boilerplate/616163a98e8734462af5f7a8/comment/6161c88718374f2573271cbf#reply-6161cbe68e8734462af5fff6)

In my “quest” to building a great state management solution I tried playing around with observables and operators as well. While not as sophisticated as Elf, I had a simple state management with the idea of “useObservable” hook. But in this particular case I tried keeping things as simple as possible. The user of the func doesn’t even know that the state is a BehaviorSubject - using Rxjs is an implementation detail. I have the same func implemented without Rxjs, it was just easier for the article.
