If the behaviour does not depend on its state, then it can be a stateless component. You can use either a function or a class to create stateless components. But unless you need to use a lifecycle hook in your components, you should go with functional components. There are many benefits if you decide to use functional components here; they are easy to write, understand and test, they are a little faster, and you can this
entirely avoid the keyword.
Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"
Comments