防止在功能组件中渲染(React.memo 不够用)

时间:2021-01-15 10:28:19

标签: reactjs react-functional-component react-memo

我有一个记忆功能组件。父库组件渲染后,react 调用 update memo 组件来检查我的 func.组件需要再次渲染。比较“current.ref === workInProgress.ref”失败并导致我的功能组件重新呈现。

function updateMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
 if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) {

“current.ref === workInProgress.ref”比较是什么意思?你能建议我了解这个的好医生吗? TIA

0 个答案:

没有答案