welldone-software/why-did-you-render

Wdyr ignores equality function in useSelector

Open

#190 aperta il 16 apr 2021

Vedi su GitHub
 (3 commenti) (1 reazione) (0 assegnatari)JavaScript (188 fork)batch import
Low prioritybuggood first issuehelp wanted

Metriche repository

Star
 (10.560 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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);

Guida contributor