What is the difference between React Component and React Element? The documentation mentions both but does not go into detail, some methods require components, other element
A React Element
is what you would consider to be a basic html(dom to be precise) element. It is just a way of creating element without using the much controversial jsx format.
A React Component
is what you can consider as an object. It has its methods, supports React lifecycles
and is generally unreusable (at least haven't found any reuse yet, welcome to examples). It necessarily needs to have a render function.
A React Class
is what you call a class. Functionality wise React Class
and React Component
are same. Only syntax is the real change, as React Component
is based on ES6 syntax
. Another major change is the default binding of functions to this is no longer supported unless using arrow functions. Mixins
also are no longer supported as of ES6
.