tf-checkout-react 1.0.82 → 1.0.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2101,14 +2101,6 @@ var FormikPhoneNumberField = function FormikPhoneNumberField(_ref) {
2101
2101
  }, rest));
2102
2102
  };
2103
2103
 
2104
- var usePrevious = function usePrevious(value) {
2105
- var ref = React.useRef();
2106
- React.useEffect(function () {
2107
- ref.current = value;
2108
- });
2109
- return ref.current;
2110
- };
2111
-
2112
2104
  var LogicRunner = function LogicRunner(_ref) {
2113
2105
  var values = _ref.values,
2114
2106
  setStates = _ref.setStates,
@@ -2348,11 +2340,20 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2348
2340
  var hideTtfOptIn = _get(cartInfoData, 'hide_ttf_opt_in', true); // Get prevProps
2349
2341
 
2350
2342
 
2351
- var prevData = usePrevious(data);
2343
+ var prevData = React.useRef(data);
2344
+ React.useEffect(function () {
2345
+ var hasUniqueId = _get(dataWithUniqueIds, '[0].uniqueId');
2346
+
2347
+ var isEqualData = _isEqual(prevData.current, data);
2352
2348
 
2353
- if (!_get(dataWithUniqueIds, '[0].uniqueId') || !_isEqual(prevData, data)) {
2354
- setDataWithUniqueIds(assingUniqueIds(data));
2355
- }
2349
+ if (!hasUniqueId || !isEqualData) {
2350
+ setDataWithUniqueIds(assingUniqueIds(data));
2351
+
2352
+ if (!isEqualData) {
2353
+ prevData.current = data;
2354
+ }
2355
+ }
2356
+ }, [dataWithUniqueIds, data]);
2356
2357
 
2357
2358
  var getQuantity = function getQuantity(cart) {
2358
2359
  if (cart === void 0) {