Stateless functions vs classes in React 16 Performance

pungggi

Do stateless functions in React 16, have, compared to classes still a better performance?

Should we still differentiate between stateless function and classes for performance reasons only?

Dmitry Platonov

I did not see any performance benefits of functional components in React. In fact, if your component is pure, inheriting from React.PureComponent gives less re-renders and, because of that, better performance. You can make functional components behave the same using pure from recompose, so it comes mostly to your preference - functional vs OOP.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

React Stateless components - performance and PureRender

React Parsing Error. Functions vs Classes

Component with shouldComponentUpdate vs stateless Component. Performance?

Spark functions vs UDF performance?

React, functions or classes?

16 to 32 bit integer conversion vs performance

React inline functions performance clarification

Stateless react functions shows invalid proptype even though it is

TSLint and React stateless component naming (PascalCase vs. camelCase)

React/prefer-stateless-function vs class decorators?

class vs className in React 16

Performance vs Readability: Local copies in functions

Lambda functions vs bind, memory! (and performance)

Performance Impact Associated with Functions vs Properties

React HOCs vs Helper Classes?

Functions in stateless components?

Grouping tests in pytest: Classes vs plain functions

Static vs class functions/variables in Swift classes?

Classes: methods not intrinsically related to an object vs functions

React and pre-binding functions for performance

@Stateless vs @RequestScoped

Stateless vs Stateful Microservices

Stateless Vs Stateful rebuild

How will React 0.14's Stateless Components offer performance improvements without shouldComponentUpdate?

React performance: bind vs anonymous function

React Native Performance: Javascript vs Typescript

React Native fetch vs XMLHttpRequest performance

Are there any performance (or otherwise) differences concerning attributes vs. classes?

Performance of BeanUtils vs. ReflectionToStringBuilder (for use in Bean classes)