Skip to content

Commit

Permalink
fix: Wrap console.log into process.env.NODE_ENV === 'development' to …
Browse files Browse the repository at this point in the history
…not show in production or tests as we can assume this is indented in this case.
  • Loading branch information
swernerx committed Nov 8, 2017
1 parent 4f011fd commit 1d1ad56
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 1d1ad56

Please # to comment.