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