August 2017
Beginner
374 pages
10h 41m
English
Now, we can turn this functional component into a class by performing the following steps:
class Timer extends React.Component {
Classes in ES2015 JavaScript work similar to classes in Java. They contain functions (methods) and variables/constants. Although you have to be careful, as there are some differences when it comes to inheritance. However, you should not have to deal with these differences, because when using React, you should favor composition (wrapping components in other components) over inheritance (extending components from other components).
Read now
Unlock full access