diff --git a/src/toUrl.js b/src/toUrl.js index 25c48c5..e6e2422 100644 --- a/src/toUrl.js +++ b/src/toUrl.js @@ -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 '#' }