Skip to content

Conversation

@amandasavluchinske
Copy link
Contributor

https://stackoverflow.com/questions/56002538/why-use-stateless-functional-components-instead-of-class-based-components

So why should I use functional components at all?

You might ask yourself why you should use functional components at all, if they remove so many nice features. But there are some benefits you get by using functional components in React:

- Functional component are much easier to read and test because they are plain JavaScript functions without state or lifecycle-hooks
- You end up with less code
- They help you to use best practices. It will get easier to separate container and presentational components because you need to think more about your component’s state if you don’t have access to setState() in your component
- The React team mentioned that there may be a performance boost for functional component in future React versions

Só alterei o que não tinha state e nem método, acho que vai ficar mais clean mas fica a vontade pra recusar caso não concorde com a mudança :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants