From 9038d5350790b71beee774a75f1cc1201c8ce645 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 10 Feb 2020 12:57:07 +0100 Subject: [PATCH] feat: use shallow-equal over fbjs (#587) --- packages/react-swipeable-views-utils/package.json | 4 ++-- packages/react-swipeable-views-utils/src/autoPlay.js | 4 ++-- yarn.lock | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/react-swipeable-views-utils/package.json b/packages/react-swipeable-views-utils/package.json index 93dfc0ce..cff180f8 100644 --- a/packages/react-swipeable-views-utils/package.json +++ b/packages/react-swipeable-views-utils/package.json @@ -16,11 +16,11 @@ }, "dependencies": { "@babel/runtime": "7.0.0", - "fbjs": "^0.8.4", "keycode": "^2.1.7", "prop-types": "^15.6.0", "react-event-listener": "^0.6.0", - "react-swipeable-views-core": "^0.13.7" + "react-swipeable-views-core": "^0.13.7", + "shallow-equal": "^1.2.1" }, "devDependencies": { "pkgfiles": "^2.3.2" diff --git a/packages/react-swipeable-views-utils/src/autoPlay.js b/packages/react-swipeable-views-utils/src/autoPlay.js index c4d1b10b..5cde3808 100644 --- a/packages/react-swipeable-views-utils/src/autoPlay.js +++ b/packages/react-swipeable-views-utils/src/autoPlay.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import shallowEqual from 'fbjs/lib/shallowEqual'; +import { shallowEqualObjects } from 'shallow-equal'; import EventListener from 'react-event-listener'; import { mod } from 'react-swipeable-views-core'; @@ -31,7 +31,7 @@ export default function autoPlay(MyComponent) { } componentDidUpdate(prevProps) { - const shouldResetInterval = !shallowEqual( + const shouldResetInterval = !shallowEqualObjects( { index: prevProps.index, interval: prevProps.interval, diff --git a/yarn.lock b/yarn.lock index 5a2ee238..36202642 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4811,7 +4811,7 @@ fastparse@^1.1.1: resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" integrity sha1-0eJkOzipTXWDtHkGDmxK/8lAcfg= -fbjs@^0.8.1, fbjs@^0.8.16, fbjs@^0.8.4: +fbjs@^0.8.1, fbjs@^0.8.16: version "0.8.17" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90= @@ -9428,6 +9428,11 @@ shallow-clone@^3.0.0: dependencies: kind-of "^6.0.2" +shallow-equal@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da" + integrity sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA== + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"