UNPKG

970 BJavaScriptView Raw
1/* eslint-disable prefer-arrow-callback, no-empty */
2"use strict";
3
4var printWarning = function() {};
5
6if (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 // --- Welcome to debugging React Router ---
23 // This error was thrown as a convenience so that you can use the
24 // stack trace to find the callsite that triggered this warning.
25 throw new Error(message);
26 } catch (e) {}
27 };
28}
29
30module.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};