ES6 Classes
Explore the fundamentals of JavaScript ES6 classes and their role in building React class components. Understand how inheritance via extends connects components and why the render method is essential for defining output in React. This lesson helps you grasp core concepts needed to work confidently with React class-based components.
We'll cover the following...
JavaScript ES6 introduced classes, which are commonly used in object-oriented programming languages. JavaScript, always flexible in its programming paradigms, allows functional programming and object-oriented programming to work side-by-side.
While React embraces functional programming, e.g. immutable data structures and function compositions, classes are used to declare ES6 class components. React mixes the good parts of both programming paradigms.
Consider the following Developer class to examine a JavaScript ES6 class without a component.
A class has a constructor to make it instantiable. The ...