@tanstack/react-router-devtools 0.0.1-beta.69 → 0.0.1-beta.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -62,6 +62,24 @@
62
62
  throw new Error(value);
63
63
  }
64
64
 
65
+ function warning(condition, message) {
66
+ {
67
+ if (condition) {
68
+ return;
69
+ }
70
+
71
+ var text = "Warning: " + message;
72
+
73
+ if (typeof console !== 'undefined') {
74
+ console.warn(text);
75
+ }
76
+
77
+ try {
78
+ throw Error(text);
79
+ } catch (x) {}
80
+ }
81
+ }
82
+
65
83
  /**
66
84
  * router
67
85
  *
@@ -76,15 +94,6 @@
76
94
  function last(arr) {
77
95
  return arr[arr.length - 1];
78
96
  }
79
- function warning(cond, message) {
80
- if (cond) {
81
- if (typeof console !== 'undefined') console.warn(message);
82
- try {
83
- throw new Error(message);
84
- } catch {}
85
- }
86
- return true;
87
- }
88
97
 
89
98
  /**
90
99
  * react-store
@@ -156,7 +165,7 @@
156
165
  const routerContext = /*#__PURE__*/React__namespace.createContext(null);
157
166
  function useRouterContext() {
158
167
  const value = React__namespace.useContext(routerContext);
159
- warning(!value, 'useRouter must be used inside a <Router> component!');
168
+ warning(value, 'useRouter must be used inside a <Router> component!');
160
169
  useStore(value.router.store);
161
170
  return value.router;
162
171
  }