react-router-tools
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -46,9 +46,12 @@ import React from 'react'; | ||
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
renderFn = _ref2.render; | ||
renderFn = _ref2.render, | ||
overrideComponent = _ref2.component; | ||
var child = null; | ||
var useComponent = overrideComponent || component; | ||
if (renderFn || render) { | ||
child = React.createElement(Route, { key: fullPath, path: fullPath, render: renderFn || render, exact: exact }); | ||
} else if (component) { | ||
child = React.createElement(Route, { key: fullPath, path: fullPath, component: component, exact: exact }); | ||
} else if (useComponent) { | ||
child = React.createElement(Route, { key: fullPath, path: fullPath, component: useComponent, exact: exact }); | ||
} else { | ||
@@ -55,0 +58,0 @@ child = React.createElement( |
@@ -64,9 +64,12 @@ 'use strict'; | ||
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
renderFn = _ref2.render; | ||
renderFn = _ref2.render, | ||
overrideComponent = _ref2.component; | ||
var child = null; | ||
var useComponent = overrideComponent || component; | ||
if (renderFn || render) { | ||
child = _react2.default.createElement(_reactRouter.Route, { key: fullPath, path: fullPath, render: renderFn || render, exact: exact }); | ||
} else if (component) { | ||
child = _react2.default.createElement(_reactRouter.Route, { key: fullPath, path: fullPath, component: component, exact: exact }); | ||
} else if (useComponent) { | ||
child = _react2.default.createElement(_reactRouter.Route, { key: fullPath, path: fullPath, component: useComponent, exact: exact }); | ||
} else { | ||
@@ -73,0 +76,0 @@ child = _react2.default.createElement( |
{ | ||
"name": "react-router-tools", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A collection of assorted React Router(v4) utility functions", | ||
@@ -5,0 +5,0 @@ "author": "Fredrik Westmark (fredrik.westmark@gmail.com)", |
@@ -30,8 +30,10 @@ import React from 'react'; | ||
// eslint-disable-next-line | ||
route: ( { render: renderFn } = {} ) => { | ||
route: ( { render: renderFn, component: overrideComponent } = {} ) => { | ||
let child = null; | ||
const useComponent = overrideComponent || component; | ||
if ( renderFn || render ) { | ||
child = ( <Route key={ fullPath } path={ fullPath } render={ renderFn || render } exact={ exact } /> ); | ||
} else if ( component ) { | ||
child = ( <Route key={ fullPath } path={ fullPath } component={ component } exact={ exact } /> ); | ||
} else if ( useComponent ) { | ||
child = ( <Route key={ fullPath } path={ fullPath } component={ useComponent } exact={ exact } /> ); | ||
} else { | ||
@@ -38,0 +40,0 @@ child = ( |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11500
269