Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
fix lint, fix error in propType handling - triggered warning all the …
Browse files Browse the repository at this point in the history
…time
  • Loading branch information
cellog committed Mar 25, 2017
1 parent 71679cb commit 91f047f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-redux-saga-router",
"version": "0.6.1",
"version": "0.6.2",
"description": "elegant powerful routing based on the simplicity of storing url as state",
"main": "lib/index.js",
"directories": {
Expand Down
6 changes: 3 additions & 3 deletions src/Toggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export default (isActive, loaded = () => true, componentLoadingMap = {}, debug =
loadingComponent: null
}

function Toggle({ component: Component = defaults.component, else: ElseComponent = defaults.else,
loadingComponent: Loading = defaults.loadingComponent, children, ...props }) {
function Toggle({ component: Component = defaults.component, else: ElseComponent = defaults.else, // eslint-disable-line
loadingComponent: Loading = defaults.loadingComponent, children, ...props }) { // eslint-disable-line
const useProps = { ...props }
const map = ['component', 'loadingComponent', 'else']
map.forEach((item) => {
Expand Down Expand Up @@ -110,7 +110,7 @@ export default (isActive, loaded = () => true, componentLoadingMap = {}, debug =
[names.component]: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
[names.loadingComponent]: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
loading: (props, propName, componentName) => {
if (!Object.hasOwnProperty.call(props, 'loadingComponent')) {
if (Object.hasOwnProperty.call(props, 'loading') && !Object.hasOwnProperty.call(props, 'loadingComponent')) {
if (!componentLoadingMap.loadingComponent) {
console.warn(`${propName} in ${componentName} should be loadingComponent for react-redux-saga-router`)
}
Expand Down

0 comments on commit 91f047f

Please sign in to comment.