Explain the difference between functional and class components.

devquora
devquora

Posted On: Feb 22, 2018

 

Functional components are those components that returns React elements as a result. These are just simple old JavaScript functions. React 0.14 has given a new shortcut for creating simple stateless components that are known as functional components. These components make use of easy JavaScript functions.

Class components – most of the tech-savvy people are more familiar with class components as they have been around the corner for a longer time. These components make use of plain old javascript objects for creating pages, mixins, etc in an identical way. Using React’s create a class factory method, a literal is passed in defining the methods of a new component.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    React Js Interview Questions

    What is ReactJS ?

    React js is javascript based UI Library developed at Facebook, to create an interactive, stateful & reusable UI com..

    React Js Interview Questions

    List some advantages of ReactJS ?

    Advantages of React JsReact.js is extremely efficient: React.js creates its own virtual DOM where your components act..

    React Js Interview Questions

    What are Components in ReactJS ?

    React Components let you split the UI into independent, reusable pieces, and think about each piece in isolation.Concep..