DEV Community

Discussion on: The Power of React Hooks - Create an app using only this feature in React

Collapse
 
kvsn_1 profile image
Sasikant • Edited

Hi,

When I first saw the title of the article, I was excited. I have some knowledge of Hooks but I also wanted to make something with it to absorb the core concepts. When you listed all the Hook API's you'll be using on this project, I was more excited. I began following the instructions and when I reached the first Provider.js file, I was shocked.

There was too much code in that file for a beginner. By beginner, I mean any person who has just started this project with the hope to learn the Hooks concepts one by one.

Pasting all the code initially in one single file and then explaining the code in big paragraphs doesn't help a beginner. Only an experienced dev would feel comfortable handling large chunks of code and their explanations provided afterwards.

A beginner would like to take one small step at a time, expecting to see the code in action in browser, when small changes are made in editor, if they can see the change appearing in the browser, that helps build memory, absorb concepts.

I personally know the hard work involved in writing an article. Especially when the article involves explanation of the code. I appreciate your efforts very much.

I know that breaking the slotify project into much smaller chunks would have taken lot more of your time. However, from a beginner's perspective this was heavy.

Just wanted to let you know about this. Thank you for making the efforts to write this article. Peace!

Collapse
 
jsmanifest profile image
jsmanifest • Edited

Hi Nair. Thank you for the honesty and the suggestion. If that is really the case I might have to figure something out. I written a longer tutorial using the approaches you suggested of going through each step in smaller chunks. The problem with the outcome was that it ended up having a really, really low read ratio and i was having the impression that the length of the post was scaring readers away or people were giving up half way into the tutorial because it felt too long. That was sorta the reason why I wrote this post this way. A solution might be to write my posts in a series like a part one, part two. As a learner reading through tutorials, would that help?

Collapse
 
kvsn_1 profile image
Sasikant

Thanks for responding. Yes, I believe breaking down the project into smaller chunks and posting it in series is a great idea. After finishing each article, the reader should take something concrete out of it. I mean concept wise.

For example, let's assume the first article of the series explains the application of useState() and useEffect(). The reader will learn about the syntax, how to set initial state, how it appears in react dev tools etc. You can have the reader interact with the component and showcase how it is being handled in the react dev tools and which function gets called to update the state compared to setState() in class components.

Then proceed with useEffect() to explain how it compares with lifecycle methods of class based components. You'll be moving forward with your example slotify project as well as the reader will be grasping the Hooks API concepts one by one, seeing it in action, giving the reader opportunity to tinker with it.

Sometimes, you may need to add code/stuff in a post which might not be directly relevant to the slotify project but will contribute while explaining the concepts. When you feel you've explained enough, you can come back to the project and have the reader rewrite the code making them understand the reasoning behind this.

This way, even if the reader doesn't proceed to other posts of the series, they'll remember how the useState() and useEffect() worked. They'll definitely remember the person who taught them :)

My first hands on experience with React Hooks was due to this article by David Katz. I really liked his approach.

medium.com/@dtkatz/react-hooks-tut...