-1

Can someone explain which one is more useful to use, and why? I can't understand why I need to know class components when there is functional which is much cleaner

0

1 Answer 1

4

Before the introduction of React Hooks, you had to use Class Components to be able to use lifecycle methods (componentDidMount..) and locale state.

You don't need anymore with React hooks, and today, you should only use functional component. They are much easier to read, test and debug and you'll end up with less code to write.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.