Skip to content

Commit

Permalink
fix: remove lodash dependency (#277)
Browse files Browse the repository at this point in the history
* Remove lodash dependency and replace isFunction with vanilla js function check

* Add package-lock.json
  • Loading branch information
lcheunglci authored Mar 10, 2022
1 parent d30b13c commit 3590bd9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions src/LinkContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 3590bd9

Please sign in to comment.