Tag

Object.is

1 views collected around this technical thread.

Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
Aug 16, 2017 · Frontend Development

Why React PureComponent’s Shallow Comparison Fails on Nested Objects

This article explains the shallow comparison used by React's PureComponent, details the implementation of shallowEqual and Object.is, and shows why such a shallow check cannot correctly compare nested objects, providing code examples and clear explanations.

FrontendJavaScriptObject.is
0 likes · 7 min read
Why React PureComponent’s Shallow Comparison Fails on Nested Objects