spinning-router 0.0.4 → 0.0.5

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.
@@ -74,6 +74,7 @@ const SpinningRouter = ({ routes, errorPage = DefaultErrorPage_1.DefaultErrorPag
74
74
  window.removeEventListener("softRefresh", doSoftRefresh);
75
75
  };
76
76
  }, []);
77
- return ((0, jsx_runtime_1.jsxs)(Location_1.Location.Provider, { value: { path, match, parameters }, children: [element, overlay] }));
77
+ window.SpinningRouterLocation = { path, match, parameters };
78
+ return ((0, jsx_runtime_1.jsxs)(Location_1.Location.Provider, { value: Object.assign({}, window.SpinningRouterLocation), children: [element, overlay] }));
78
79
  };
79
80
  exports.SpinningRouter = SpinningRouter;
package/dist/link.js CHANGED
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.link = exports.unsafeLink = void 0;
4
- const Location_1 = require("./Location");
5
- const react_1 = require("react");
6
4
  const unsafeLink = (path, values) => {
7
5
  let result = [];
8
6
  for (let part of path.split("/")) {
9
7
  if (part.startsWith(":")) {
10
8
  const key = part.substring(1);
11
- let value = values && values[key] !== undefined ? values[key] : (0, react_1.useContext)(Location_1.Location).parameters[key];
9
+ let value = values && values[key] !== undefined ? values[key] : window.SpinningRouterLocation.parameters[key];
12
10
  result.push(encodeURIComponent(value));
13
11
  }
14
12
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spinning-router",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "n/a",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",