react-router-transition
Advanced tools
| function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
| import React from 'react'; | ||
| import Route from 'react-router-dom/Route'; | ||
| import matchPath from 'react-router-dom/matchPath'; | ||
| import { Route, matchPath } from 'react-router-dom'; | ||
@@ -7,0 +6,0 @@ import RouteTransition from './RouteTransition'; |
@@ -14,5 +14,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
| import React from 'react'; | ||
| import Route from 'react-router-dom/Route'; | ||
| import Switch from 'react-router-dom/Switch'; | ||
| import matchPath from 'react-router-dom/matchPath'; | ||
| import { Route, Switch, matchPath } from 'react-router-dom'; | ||
| import PropTypes from 'prop-types'; | ||
@@ -19,0 +17,0 @@ |
+4
-10
@@ -9,10 +9,4 @@ 'use strict'; | ||
| var _Route = require('react-router-dom/Route'); | ||
| var _reactRouterDom = require('react-router-dom'); | ||
| var _Route2 = _interopRequireDefault(_Route); | ||
| var _matchPath = require('react-router-dom/matchPath'); | ||
| var _matchPath2 = _interopRequireDefault(_matchPath); | ||
| var _RouteTransition = require('./RouteTransition'); | ||
@@ -34,3 +28,3 @@ | ||
| return (0, _matchPath2.default)(pathname, { exact: exact, path: path }) ? 'match' : 'no-match'; | ||
| return (0, _reactRouterDom.matchPath)(pathname, { exact: exact, path: path }) ? 'match' : 'no-match'; | ||
| } | ||
@@ -44,3 +38,3 @@ | ||
| return _react2.default.createElement(_Route2.default, { | ||
| return _react2.default.createElement(_reactRouterDom.Route, { | ||
| render: function render(_ref3) { | ||
@@ -52,3 +46,3 @@ var location = _ref3.location, | ||
| routeTransitionProps, | ||
| _react2.default.createElement(_Route2.default, { | ||
| _react2.default.createElement(_reactRouterDom.Route, { | ||
| key: getKey(location, path, exact), | ||
@@ -55,0 +49,0 @@ path: path, |
@@ -13,14 +13,4 @@ 'use strict'; | ||
| var _Route = require('react-router-dom/Route'); | ||
| var _reactRouterDom = require('react-router-dom'); | ||
| var _Route2 = _interopRequireDefault(_Route); | ||
| var _Switch = require('react-router-dom/Switch'); | ||
| var _Switch2 = _interopRequireDefault(_Switch); | ||
| var _matchPath = require('react-router-dom/matchPath'); | ||
| var _matchPath2 = _interopRequireDefault(_matchPath); | ||
| var _propTypes = require('prop-types'); | ||
@@ -61,3 +51,3 @@ | ||
| return _react2.default.Children.toArray(children).find(function (child) { | ||
| return (0, _matchPath2.default)(pathname, { | ||
| return (0, _reactRouterDom.matchPath)(pathname, { | ||
| exact: child.props.exact, | ||
@@ -114,3 +104,3 @@ path: child.props.path | ||
| _react2.default.createElement( | ||
| _Switch2.default, | ||
| _reactRouterDom.Switch, | ||
| { key: this.state.key, location: location }, | ||
@@ -130,3 +120,3 @@ children | ||
| var RouteWrapper = function RouteWrapper(props) { | ||
| return _react2.default.createElement(_Route2.default, { | ||
| return _react2.default.createElement(_reactRouterDom.Route, { | ||
| children: function children(_ref2) { | ||
@@ -133,0 +123,0 @@ var location = _ref2.location; |
+4
-4
| { | ||
| "name": "react-router-transition", | ||
| "version": "1.2.1", | ||
| "version": "1.3.0", | ||
| "description": "A thin layer over react-motion for animating routes in react-router.", | ||
@@ -38,8 +38,8 @@ "main": "lib/react-router-transition.js", | ||
| "react": "^15.0.0 || ^16.0.0", | ||
| "react-dom": "^15.0.0 || ^16.0.0" | ||
| "react-dom": "^15.0.0 || ^16.0.0", | ||
| "react-router-dom": "^4.1.1" | ||
| }, | ||
| "dependencies": { | ||
| "prop-types": "^15.5.10", | ||
| "react-motion": "^0.5.0", | ||
| "react-router-dom": "^4.1.1" | ||
| "react-motion": "^0.5.0" | ||
| }, | ||
@@ -46,0 +46,0 @@ "devDependencies": { |
+2
-3
@@ -10,9 +10,8 @@ # React Router Transition | ||
| `npm install --save react-router-transition` | ||
| `npm install --save react-router-transition react-router-dom` | ||
| ### Example Usage | ||
| ```jsx | ||
| import Router from 'react-router-dom/BrowserRouter'; | ||
| import { BrowserRouter as Router, Route } from 'react-router-dom'; | ||
| import { AnimatedSwitch } from 'react-router-transition'; | ||
| import Route from 'react-router-dom/Route'; | ||
@@ -19,0 +18,0 @@ export default () => ( |
| import React from 'react'; | ||
| import Route from 'react-router-dom/Route'; | ||
| import matchPath from 'react-router-dom/matchPath'; | ||
| import { Route, matchPath } from 'react-router-dom'; | ||
@@ -5,0 +4,0 @@ import RouteTransition from './RouteTransition'; |
| import React from 'react'; | ||
| import Route from 'react-router-dom/Route'; | ||
| import Switch from 'react-router-dom/Switch'; | ||
| import matchPath from 'react-router-dom/matchPath'; | ||
| import { Route, Switch, matchPath } from 'react-router-dom'; | ||
| import PropTypes from 'prop-types'; | ||
@@ -6,0 +4,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
568454
86.82%6299
67.79%54
-1.82%41
41.38%- Removed