welldone-software/why-did-you-render

Wdyr ignores equality function in useSelector

Aberta

#190 aberto em 16 de abr. de 2021

 (3 comentários) (1 reação) (0 responsável)JavaScript (188 forks)batch import
Low prioritybuggood first issuehelp wanted

Métricas do repositório

Stars
 (10.560 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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

Guia do colaborador