Reputation: 9167
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
Reputation: 7504
There are several cons:
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.
Could face issues like memoized data is not updating on state change or vice versa.
You shouldn't use it when:
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.
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