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 thedisabled
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.