From 14b72d8989e3416a5f0d4cb99688de71ce6a97a7 Mon Sep 17 00:00:00 2001 From: Lawrence LCI Date: Wed, 9 Mar 2022 16:19:01 -0800 Subject: [PATCH 1/2] Remove lodash dependency and replace isFunction with vanilla js function check --- package.json | 1 - src/LinkContainer.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index 0c3cc73..7c5dc81 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,6 @@ "html-webpack-plugin": "^5.5.0", "jasmine-enzyme": "^7.1.2", "jest": "^26.6.3", - "lodash": "^4.17.21", "prettier": "^2.4.1", "react": "^16.14.0", "react-bootstrap": "^1.6.4", diff --git a/src/LinkContainer.js b/src/LinkContainer.js index 91072ec..9cc6844 100644 --- a/src/LinkContainer.js +++ b/src/LinkContainer.js @@ -6,7 +6,6 @@ import { useMatch, useNavigate, } from 'react-router-dom'; -import { isFunction } from 'lodash'; const isModifiedEvent = (event) => !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); @@ -32,7 +31,7 @@ const LinkContainer = ({ const child = React.Children.only(children); const isActive = !!(getIsActive - ? isFunction(getIsActive) + ? typeof getIsActive === 'function' ? getIsActive(match, location) : getIsActive : match); From 4e3acb9df403072858fdfa58b7ddb107f7c399f2 Mon Sep 17 00:00:00 2001 From: Lawrence LCI Date: Wed, 9 Mar 2022 16:49:05 -0800 Subject: [PATCH 2/2] Add package-lock.json --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 1dba2fe..19ca935 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-router-bootstrap", - "version": "0.25.0", + "version": "0.26.0", "lockfileVersion": 1, "requires": true, "dependencies": {