Arseniy-II
Arseniy-II

Reputation: 9167

Cons of Reselect

The main question is simple: What are the cons of reselect?

According to numerous articles 1 2 reselect is a great library that solves a number of problems. And it always sounds like we have to use it.

But what you quickly learn during development there is no such thing as "must have" library. You always decide what you should use depends of your needs and resource.

What are the cons of? When I shouldn't use it?

Upvotes: 1

Views: 489

Answers (1)

Vinay Prajapati
Vinay Prajapati

Reputation: 7504

There are several cons:

  1. As reselect recomputes on change in input value. If your input tree is too large, the computation might be expensive too. Hence, it could lead to performance issues.

  2. Could face issues like memoized data is not updating on state change or vice versa.

You shouldn't use it when:

  1. You have too large & real time state. Rather than computing data using reselect your state must be organized to carry such computations even if there is some duplicate data. e.g. Application that need high real time data.

  2. You don't want to use a store e.g. with react 16.8.x. You can always watch/compute the data using refs, useState etc or useReducer etc.

Upvotes: 3

Related Questions