UNPKG

930 BJavaScriptView Raw
1"use strict";
2
3var printWarning = function() {};
4
5if (process.env.NODE_ENV !== "production") {
6 printWarning = function(format, subs) {
7 var index = 0;
8 var message =
9 "Warning: " +
10 (subs.length > 0
11 ? format.replace(/%s/g, function() {
12 return subs[index++];
13 })
14 : format);
15
16 if (typeof console !== "undefined") {
17 console.error(message);
18 }
19
20 try {
21 // --- Welcome to debugging React Router ---
22 // This error was thrown as a convenience so that you can use the
23 // stack trace to find the callsite that triggered this warning.
24 throw new Error(message);
25 } catch (e) {}
26 };
27}
28
29export default function(member) {
30 printWarning(
31 'Please use `import { %s } from "react-router"` instead of `import %s from "react-router/es/%s"`. ' +
32 "Support for the latter will be removed in the next major release.",
33 [member, member]
34 );
35}