FormidableLabs / react-fast-compare

fastest deep equal comparison for React
MIT License
1.59k stars 54 forks source link

Property "_store" not present in production React Elements #25

Closed chen-ye closed 6 years ago

chen-ye commented 6 years ago

react_fast_compare checks for the existence of _store in order to verify the compared object is a React element, and avoid react-specific circular references.

However, this property is not created in production environments (as can be seen at https://github.com/facebook/react/blob/master/packages/react/src/ReactElement.js#L126).

As a result, react_fast_compare doesn't omit circular references in production.

chen-ye commented 6 years ago

(Apologies for formatting, on mobile)

chrisbolin commented 6 years ago

Thank you for reporting this! We'll check it!!!

chen-ye commented 6 years ago

Here's a reproduction Works fine in dev environments: https://codesandbox.io/s/nk6rzr7z64 But fails to omit _owner in prod: https://csb-nk6rzr7z64-cfyxlokhrg.now.sh/

chrisbolin commented 6 years ago

fixed with react-fast-compare@2.0.1

🙇 @chen-ye