THE STATE HOOK lesson is poorly designed

At the beginning of this lesson we are told this:

Classes, however, are not simple. They:

  • are difficult to reuse between components
  • are tricky and time-consuming to test
  • have confused many developers and caused lots of bugs

…With Hooks, we can use simple function components to do lots of the fancy things that we could only do with class components in the past.

Yet after that lesson, here I am sitting without any idea of what I’ve learned, to such point that I couldn’t do the lesson review exercise.
Hooks are supposed to make everything simple yet Codecademy made this into one of the most difficult subjects.

I don’t know why this lesson was made in this way (without any clear explanation or even one single hint), but it surely made everything worse.

I was very excited to learn Hooks since they are the new feature that many use but right now, I actually find class components easier to understand. I know it’s optional to use whatever method one’s comfortable with but that isn’t an excuse.

If you think I’m overreacting just look at this part from this exercise:
The step says this:

Add an onFirstQuestion variable with a boolean value then use that value to toggle the disabled attribute of the “Go Back” button on and off.

The solution is this:

const onFirstQuestion = questionIndex === 0;
<button disabled={onFirstQuestion} onClick={goBack}>

Now just tell me how can someone learning through these lessons get to that code by just reading that step (without any hint!)?

As of now, I’m very disappointed with Codecademy and am sure others going through this part feel the same way.

I really hope Codecademy fixes their lessons so that we can actually learn stuff and not just gain this false confidence from copying/pasting stuff.

P.S. My advice to you who’s reading this is to find another more clear and comprehensive source for learning React Hooks until Codecademy fixes this poorly designed lesson.


It seem that Codecademy has provided the lessons of useState() and useEffect() with hints for each step.
It’s really nice to see them improving their exercises by listening to our feedback.

Thank you very much for this, Codecademy!

1 Like

I’m glad I’m not the only one who feels this way. I learned a lot and I feel like I understand the lesson material but the projects are ridiculous. First they cut everything into baby sized chunks like they are afraid to let you try to code it on your own. For instance they will just have you put in the default value for a useState() variable declaration. Then out of nowhere when you have almost no experience with the .filter method which they barely brushed over in the JavaScript course they want you to use it inside a state setter function which is inside an event handler and give you no clues on what you are supposed to do when they never even brought up a filter function before that.

This poster is right the end project equally absurd. Could you imagine your first day on a job where your boss goes. “Hey rewrite this whole section with Hooks instead of class components and oh yeah use this code editor where you can’t see any errors that pop up and by the way even if your code works and gives the desired effect we are still going to say your code is wrong and you can’t continue to a new ticket!”

1 Like

Definitely need to agree on your thoughts.
I was really excited about State and Effect Hooks, since I talked with a friend (Full Stack Developer) of mine, told him I made huge progress learning Component Classes. He told me, most developers are using function components these days, also that they are much easier, because they read more like common javascript.

Anyway, after a weekend with the Hooks lessons I felt like I learned what Hooks are about and when to use them, but the CodeAcademy Instructions was poorly designed to previous lessons. I had a hard time solving the tasks, also due to some little bugs in the course (code was correct, but simple “;”, order of Attributes …, made this course really time consuming and frustrating.

Previous Courses was beautifully designed:
Piece by Piece, //Notes where to place the code for a task (How am I supposed to know, where to place a EffectHook correctly and why) and while some lessons made sense and was easy to understand (colors, ingredients from the delivery service, taskmaker) others could be reduced to use / mirror much simpler logic. And instead of "Yeah, last lesson, rewrite the app on yourself, it would have been much better, to create a ending-project for each hook lesson.

I don’t know, the Hook Lessons just didn’t turned out to be fun, and everything felt quite rushed.

1 Like