C
C
cython2019-05-21 14:46:28
React
cython, 2019-05-21 14:46:28

What is the difference between the ways to create components?

What is the difference between creating components via: arrow function, classes from new versions of ES and React.createClass. Also, what is the best way to use it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2019-05-21
@cython

What is the difference between creating components via: arrow function, classes from new versions of ES and React.createClass.

State and lifecycle methods are available in class components. In functional components,
similar functionality is achieved using the Hooks API.
The React.createClass method has been replaced by the create-react-class external module and is used in projects that do not use ES6 for some reason.
Use arrow functions and classes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question