Skip to content

Commit 1678436

Browse files
authored
Merge pull request faceyspacey#78 from swernerx/master
Wrap console.log into process.env.NODE_ENV === 'development' to not show in production/test
2 parents 4f011fd + 1d1ad56 commit 1678436

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/toUrl.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,24 @@ export default (to?: ?To, routesMap: RoutesMap): string => {
2020
return actionToPath(action, routesMap, querySerializer)
2121
}
2222
catch (e) {
23-
console.warn(
24-
'[redux-first-router-link] could not create path from action:',
25-
action,
26-
'For reference, here are your current routes:',
27-
routesMap
28-
)
23+
if (process.env.NODE_ENV === 'development') {
24+
console.warn(
25+
'[redux-first-router-link] could not create path from action:',
26+
action,
27+
'For reference, here are your current routes:',
28+
routesMap
29+
)
30+
}
2931

3032
return '#'
3133
}
3234
}
3335

34-
console.warn(
35-
'[redux-first-router-link] `to` prop must be a string, array or action object. You provided:',
36-
to
37-
)
36+
if (process.env.NODE_ENV === 'development') {
37+
console.warn(
38+
'[redux-first-router-link] `to` prop must be a string, array or action object. You provided:',
39+
to
40+
)
41+
}
3842
return '#'
3943
}

0 commit comments

Comments
 (0)