welldone-software/why-did-you-render

Wdyr ignores equality function in useSelector

Open

#190 geöffnet am 16. Apr. 2021

Auf GitHub ansehen
 (3 Kommentare) (1 Reaktion) (0 zugewiesene Personen)JavaScript (10.560 Stars) (188 Forks)batch import
Low prioritybuggood first issuehelp wanted

Beschreibung

When using wdyr I noticed that it reports unnecessary renders caused by useSelector with an equality function even though the equality function causes the render to be avoided. Looking at the code it looks like wdyr does not consider the result of the equality function.

An example:

useSelector(someSelector, (prev, next) => true);

Contributor Guide