0% found this document useful (0 votes)
17 views1 page

Are Equal

Uploaded by

mahoraga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

Are Equal

Uploaded by

mahoraga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

// @flow

import shallowDiffers from './shallowDiffers';

// Custom comparison function for React.memo().


// It knows to compare individual style props and ignore the wrapper object.
// See https://reactjs.org/docs/react-api.html#reactmemo
export default function areEqual(
prevProps: Object,
nextProps: Object
): boolean {
const { style: prevStyle, ...prevRest } = prevProps;
const { style: nextStyle, ...nextRest } = nextProps;

return (
!shallowDiffers(prevStyle, nextStyle) && !shallowDiffers(prevRest, nextRest)
);
}

You might also like