DEV Community

Discussion on: Learn React in Plain English

 
cariehl profile image
Cooper Riehl

@ivanjeremic Thanks for the comment! Could you give me an example where I might need to use a class component instead of a function component? Are class components only necessary when I want to implement additional functionality for the component, such as (not sure if this is the right term to use) React hooks?

Thread Thread
 
ivan_jrmc profile image
Ivan Jeremic

React hooks are used only in function components and do not work in class components. So all you need is to learn how hooks work.

Thread Thread
 
Sloan, the sloth mascot
Comment deleted
 
ivan_jrmc profile image
Ivan Jeremic • Edited

Anything specific you want me to read? I read this page already. If you mean functions and class components are the same they are not, in the page you sent me it says react does't care from react's point of view a component is a component which is true but not from the developers point of view if you write components as classes they are totally different then functions and you cannot use hooks in class components.