I Created React AppState! 🤗
Ryota Murakami
・1 min read
Why React doesn't provide straightforward way to get/set value without Component hierarchy? 🤔
I saw Andrew Clark opened PR that get/settable context feature once but there is no exists it in the current Context.
I guess there is any complex circumstances barrier so I wanna investigate past PR discussion. 🕵️♂️
Anyway, I created straightforward library that simple combination of context, state, hook to make get/settable context aka you know, just global store.
Get by 😆: https://github.com/ryota-murakami/react-appstate
If you need handle entire React App states Like DarkThemeButton, uncompleted input, control modal/snackbars etc...
— Ryota Murakami (@malloc007 ) November 19, 2019
React AppState provide straightforward way. 😀https://t.co/qmpF3O9afM
Thank you for reading my poor English post! ☕️
Welcome comment feel free If you know more better English, If you know more tech things, or other your special 😀🚀
Related Posts
so cool! I'll give it a try the next time I work on react🌻 Good job :)
Thank you so much!
I'm so glad to hear that 🤗
You could also use redux for this though.
Redux is also nicer way, Thank you!
cool! i'll try it soon. but can you share how it differs from redux?
Originally I'm fan of Redux! So I could describe with long text containing trivial thing...
We call Redux in React world generally, that's combined 2 another library "React" "Redux" by "react-redux".
So, Redux(combined React) manage global value based on Flux essence. you know Dispatch Named Action with payload...
My React AppState has nothing to do with Redux.
Which constructed React build-in feature "state/context/hooks".
Thank you, this is great question I think.
I should start write more straight to understand post with sample code 👨💻
short answer is... React AppState designed set/get direct values 🌍
it seems very simple. i am currently developing react project with redux as its state management and i am a newbie here. i should probably try yours soon! thank you for the explanation :)
Your welcome! 🤗