I am trying to understand the exact difference between React\'s stateful and stateless components. Ok, stateless components just do something, but remember nothing, while st
Functional Component or Stateless component
- Functional component is like pure function in JavaScript.
- Functional component is also called as a stateless component.
- The functional component only receives props from parent component and return you JSX elements.
- The functional component doesn’t play with any lifecycle methods of React and doesn’t play with the component state.
Class component or statefull component
- React class component is called as a stateful component.
- Stateful component plays with all life cycle methods of React.
- This component will modify state.
That’s the major differences
If you have knowledge about pure function in JavaScript then you can understand functional or stateless component easily.