Reputation: 41
I have read in a few places to check this problem, but didnot find any good answer. I hope good answer to it.
Upvotes: 2
Views: 979
Reputation: 1953
There is not any noticable performance difference in functional and class components. It is completely dependant on developer's preference what one likes. Just the things to note is,
reduce the number of lines
in a functional component as compared to class component.fewer limitations
in functional components as compared to class componentsThese all point in turn reduce the time of development.
You can refer to this article for more indept details: https://betterprogramming.pub/react-class-vs-functional-components-2327c7324bdd
There is also a benchmarking done in this article. https://jsfiddle.net/69z2wepo/136096/
Here are the findings:
You can notice here that, functional components take less time than class components, but not much significant.
Upvotes: 5
Reputation: 1295
I think no.
It's unlikely to see any performance difference from classes vs functions.
However the way we optimize classes and functions are different.
Upvotes: 0