Wow. Your style of teaching made it extremely easy for me to understand recoil. This is by far the best tutorial for anyone trying to get started with recoil
It's a useful tutorial, even though, the way you did is basically a global react state. This approach doesn't work for different pages, since you're using everything in the same page there's no need to use recoil actually. Try to apply the same setup in a scalable way, using different folders for atoms, the main page (index.js) and components. That's what I expected to find in the video! But, again, it work to understand that we need a wrapper for recoil, atoms and the basics.
Very much like using Context, so the RecoilRoot acts much like Provider and the atoms are like segments of the context value, then both use Hooks to wire it up to the components. I dont know why some people call this replacement for Redux when it doesnt even provide “actions” that allow separating business logic from your React components.
Yea it does feel like a lot like Context, although It is a slightly different mindset I think. In context you would generally create a new provider for each piece of 'state', whereas in Recoil the Root is a one off, also the ability to create atoms in runtime is something different to consider too. I see what you mean, I wouldn't say this is a replacement of anything yet, but I imaging people compare it with Redux because both tools tackle the same problem (state management). Actions are just one way of updating state, you could replicate that with any state management tool.
Redhwan Nacef based on Recoil usage examples floating around, it seems that there is a tendency to write business logic in components, which otherwise would have been in “actions” if Recoil offered something similar.
Yea I agree. I think at this it mostly down to personal preference, things like developer experience/api etc. There may be some differences in performance at a large scale that Recoil is supposed to be better suited for but for most projects that wont make a difference.
This looks good, but this is what I do with Context api in general, the only thing is better you wrapped the App with just one Context Provider which is Recoil root, it looks simpler and more functional. I am curious about the other benefits also.
Yea feels similar to context api, I guess the main difference is probably performance and the ability to create pieces of state at runtime with recoil. I have a video doing a comparison which may be useful to you: ua-cam.com/video/-nZIMVOtK1g/v-deo.html.
@@RedhwanNacef you're welcome. I noticed smaller channels also get straight to the point when explaining because they're also coming from a place of "what can I do with this?". Bigger channels just go around in circles before getting to the meat.
Hi Redhwan, this works as you had explained but I have a error stacktrace in console but app works as expected. Any idea how to fix this issue ? index.js:1 Warning: Cannot update a component (`he`) while rendering a different component (`Count`). To locate the bad setState() call inside `Count`, follow the stack trace as described in fb.me/setstate-in-render in Count (at App.js:42) in div (at App.js:40) in Body (at App.js:23) in div (at App.js:21)
I think Redux will be around for a long time regardless of Recoil, it is years ahead in terms of development, community and maturity as a solution. A lot of companies/teams are trained in Redux and would need a strong reason to move away from it. However in my opinion, if Recoil is able to provide all the functionality that Redux gives in the minimal approach it has, then it can definitely become a strong contender for top spot. I think it could be interesting to see how Redux may adapt in the future if that starts to happen.
@@RedhwanNacef Thank you for the reply! I'm just trying to figure out if we need both when Recoil is stable, but it seems like we might just need Recoil. I personally hate Redux for all the boiler plate crap we need to do on a daily basis.
Wow. Your style of teaching made it extremely easy for me to understand recoil. This is by far the best tutorial for anyone trying to get started with recoil
Thanks a lot! Appreciate the great feedback.
redux is sweating now . amazing tutorial ! thanks
Thanks!
Wow, a very useful tutorial. You made it so easy to learn the core concept behind Recoil in a very simple way... amazing.
Thank you!
Thanks for the feedback. Happy it helped!
awhhh man!!! switching to Recoil today from Redux... no words said!!!!
Cool!
Love the way you teach! First video and I already want to watch more of your videos. Subscribed!
Great to hear, thank you and Welcome!
Just loved your presentation
Thanks! Glad you enjoyed it 😊
Very simple and clear, thank you bro :)
No worries, thanks!
Really cool and fast tutorial!
Glad you liked it, thanks!
It's a useful tutorial, even though, the way you did is basically a global react state. This approach doesn't work for different pages, since you're using everything in the same page there's no need to use recoil actually. Try to apply the same setup in a scalable way, using different folders for atoms, the main page (index.js) and components. That's what I expected to find in the video! But, again, it work to understand that we need a wrapper for recoil, atoms and the basics.
Your style of teaching❤❤❤❤❤
Glad you like it 😊
Extremely helpful, thank you!
Glad it helped!
your lecture gives me a lot of useful thing, thanks a lot and I'll be a Recoil Master
You're welcome, glad it helped.
Thanks. The Recoil docs tutorial is confusing. You broke it down well.
Thank you.
That was sharp and clear bruh...
Thanks
This is a fantastic tutorial! You have a great style of teaching, thankyou for this, its very helpful
Thank you, glad you enjoyed it.
Great Video and precise explanation.
Thanks for the feedback, glad you enjoyed it 👍🏼
only video that helped me . thanks man
Happy it helped.
Very much like using Context, so the RecoilRoot acts much like Provider and the atoms are like segments of the context value, then both use Hooks to wire it up to the components. I dont know why some people call this replacement for Redux when it doesnt even provide “actions” that allow separating business logic from your React components.
Yea it does feel like a lot like Context, although It is a slightly different mindset I think. In context you would generally create a new provider for each piece of 'state', whereas in Recoil the Root is a one off, also the ability to create atoms in runtime is something different to consider too. I see what you mean, I wouldn't say this is a replacement of anything yet, but I imaging people compare it with Redux because both tools tackle the same problem (state management). Actions are just one way of updating state, you could replicate that with any state management tool.
Redhwan Nacef based on Recoil usage examples floating around, it seems that there is a tendency to write business logic in components, which otherwise would have been in “actions” if Recoil offered something similar.
Yea, I see what you mean.
Thanks, Very useful tutorial. Very well-explained core concepts.
You're welcome, glad you enjoyed it.
Great tutorial, love the minimaltic style :)
Thank you :)
brilliant tutorial. explained the concept very well.
Thank you. Appreciate the great feedback.
Loved it ! thanks
Thank you! 🙂
The error which I reported earlier is fixed in recoild 0.0.13, it works now.
Great
Nice one bro
Thanks.
Amazing... Keep it up bro..
Thanks!
This is neat and really easy to use. What's the reason to use Redux instead?
Yea I agree. I think at this it mostly down to personal preference, things like developer experience/api etc. There may be some differences in performance at a large scale that Recoil is supposed to be better suited for but for most projects that wont make a difference.
Thank you nice tutorial!
Glad you enjoyed it!
great tutorial!
Thanks! Glad you enjoyed it 🙂
This looks good, but this is what I do with Context api in general, the only thing is better you wrapped the App with just one Context Provider which is Recoil root, it looks simpler and more functional. I am curious about the other benefits also.
Yea feels similar to context api, I guess the main difference is probably performance and the ability to create pieces of state at runtime with recoil. I have a video doing a comparison which may be useful to you: ua-cam.com/video/-nZIMVOtK1g/v-deo.html.
nice one dude.
Thanks.
@@RedhwanNacef you're welcome. I noticed smaller channels also get straight to the point when explaining because they're also coming from a place of "what can I do with this?". Bigger channels just go around in circles before getting to the meat.
Yea that’s a fair point. I will always try get to the point quickly.
great video taught me to use recoil.
btw Recoil looks like easy than Redux, it less boilerplate than redux
Glad it was helpful.
Awesome tutorial, any idea of a stable release date?
Thanks. I have not seen any release date being confirmed yet. Worth keeping an eye out on the github repo.
Hi Redhwan, this works as you had explained but I have a error stacktrace in console but app works as expected.
Any idea how to fix this issue ?
index.js:1 Warning: Cannot update a component (`he`) while rendering a different component (`Count`). To locate the bad setState() call inside `Count`, follow the stack trace as described in fb.me/setstate-in-render
in Count (at App.js:42)
in div (at App.js:40)
in Body (at App.js:23)
in div (at App.js:21)
I see you have found out that this is fixed in a later recoil release 👍🏼
Awesome ❤️
👍🏼
This looks very similar to unstated next
Interesting, will take a look it.
Do the React functions all need to be in the same file?
No they don’t, they came be exported from different files. I kept it like this to try keep the tutorial simple.
@@RedhwanNacef Perfect, thanks!
Once recoil is ready for production, do we really need redux?
I think Redux will be around for a long time regardless of Recoil, it is years ahead in terms of development, community and maturity as a solution. A lot of companies/teams are trained in Redux and would need a strong reason to move away from it. However in my opinion, if Recoil is able to provide all the functionality that Redux gives in the minimal approach it has, then it can definitely become a strong contender for top spot. I think it could be interesting to see how Redux may adapt in the future if that starts to happen.
@@RedhwanNacef Nicely explained, thanks
Thank you, anytime.
@@RedhwanNacef Thank you for the reply! I'm just trying to figure out if we need both when Recoil is stable, but it seems like we might just need Recoil. I personally hate Redux for all the boiler plate crap we need to do on a daily basis.