1 |
|
2 | var printWarning = function() {};
|
3 |
|
4 | if (process.env.NODE_ENV !== "production") {
|
5 | printWarning = function(format, subs) {
|
6 | var index = 0;
|
7 | var message =
|
8 | "Warning: " +
|
9 | (subs.length > 0
|
10 | ? format.replace(/%s/g, function() {
|
11 | return subs[index++];
|
12 | })
|
13 | : format);
|
14 |
|
15 | if (typeof console !== "undefined") {
|
16 | console.error(message);
|
17 | }
|
18 |
|
19 | try {
|
20 |
|
21 |
|
22 |
|
23 | throw new Error(message);
|
24 | } catch (e) {}
|
25 | };
|
26 | }
|
27 |
|
28 | export default function(member) {
|
29 | printWarning(
|
30 | 'Please use `import { %s } from "react-router"` instead of `import %s from "react-router/es/%s"`. ' +
|
31 | "Support for the latter will be removed in the next major release.",
|
32 | [member, member]
|
33 | );
|
34 | }
|