welldone-software/why-did-you-render

Wdyr ignores equality function in useSelector

開放

#190 建立於 2021年4月16日

 (3 則留言) (1 個反應) (0 位負責人)JavaScript (188 個分叉)batch import
Low prioritybuggood first issuehelp wanted

倉庫指標

星標
 (10,560 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南