React.Memo is not working when prevProps and nextProps are the same

235 Views Asked by At
const propsAreEqual = (prevProps: IRangeDatePickerProps, nextProps: IRangeDatePickerProps) => {
    return prevProps.details === nextProps.details;
  }

// At botton of the file, i memoize the component: 
export default React.memo(RangeDatePicker, propsAreEqual);

In the parent component i call my RangeDatePicker like that: {isDateModalOpen && <RangeDatePicker details={details} />}

0

There are 0 best solutions below