Skip to content

Commit

Permalink
Merge pull request #78 from swernerx/master
Browse files Browse the repository at this point in the history
Wrap console.log into process.env.NODE_ENV === 'development' to not show in production/test
  • Loading branch information
faceyspacey authored Nov 9, 2017
2 parents 4f011fd + 1d1ad56 commit 1678436
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/toUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,24 @@ export default (to?: ?To, routesMap: RoutesMap): string => {
return actionToPath(action, routesMap, querySerializer)
}
catch (e) {
console.warn(
'[redux-first-router-link] could not create path from action:',
action,
'For reference, here are your current routes:',
routesMap
)
if (process.env.NODE_ENV === 'development') {
console.warn(
'[redux-first-router-link] could not create path from action:',
action,
'For reference, here are your current routes:',
routesMap
)
}

return '#'
}
}

console.warn(
'[redux-first-router-link] `to` prop must be a string, array or action object. You provided:',
to
)
if (process.env.NODE_ENV === 'development') {
console.warn(
'[redux-first-router-link] `to` prop must be a string, array or action object. You provided:',
to
)
}
return '#'
}

0 comments on commit 1678436

Please # to comment.