From the course: React Hooks

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

React Hooks history

React Hooks history - React.js Tutorial

From the course: React Hooks

Start my 1-month free trial

React Hooks history

- [Instructor] If you're familiar with React's history, you might be aware that there have been a few different ways to create components throughout time. If we hop in a time machine to between 2013 and 2017, not that long ago I realize, that meant that we would use a function called createClass to create a component. Then the createClass function would have this render method that we could use to return some UI. Then around 2017, createClass started to fall out of favor because JavaScript implemented the class syntax which lent itself really well to component creation. So that meant our components transformed to kind of look like this. We had a class, it would extend a base class called React component, and it would look pretty much the same. It was also possible around this time though to create components using a function. But anytime you added state variables, you had to refactor your function component into a class.…

Contents