@koordinates/xstate-tree 4.3.0-beta.6 → 4.3.0-beta.8

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.
@@ -54,7 +54,7 @@ function LinkInner({ to, children, testId, preloadOnHoverMs, preloadOnInteractio
54
54
  }
55
55
  }
56
56
  : undefined;
57
- return (react_1.default.createElement("a", { ...props, ref: ref, href: href, "data-testid": testId, onMouseDown: onMouseDown !== null && onMouseDown !== void 0 ? onMouseDown : _onMouseDown, onMouseEnter: onMouseEnter !== null && onMouseEnter !== void 0 ? onMouseEnter : _onMouseEnter, onMouseLeave: onMouseLeave !== null && onMouseLeave !== void 0 ? onMouseLeave : _onMouseLeave, onClick: (e) => {
57
+ return (react_1.default.createElement("a", { ...props, ref: ref, href: href, "data-testid": testId, onMouseDown: onMouseDown !== null && onMouseDown !== void 0 ? onMouseDown : _onMouseDown, onMouseEnter: onMouseEnter !== null && onMouseEnter !== void 0 ? onMouseEnter : _onMouseEnter, onMouseLeave: onMouseLeave !== null && onMouseLeave !== void 0 ? onMouseLeave : _onMouseLeave, "data-xstate-tree": true, onClick: (e) => {
58
58
  var _a;
59
59
  if (((_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e)) === false) {
60
60
  return;
package/lib/xstateTree.js CHANGED
@@ -327,10 +327,12 @@ function buildRootComponent(machine, routing) {
327
327
  };
328
328
  }, [activeRoute]);
329
329
  (0, react_2.useEffect)(() => {
330
+ var _a, _b;
330
331
  if (routing) {
331
332
  const { getPathName = () => routing.history.location.pathname, getQueryString = () => routing.history.location.search, } = routing;
333
+ const initialMeta = (_b = (_a = routing.history.location.state) === null || _a === void 0 ? void 0 : _a.meta) !== null && _b !== void 0 ? _b : {};
332
334
  const queryString = getQueryString();
333
- const result = (0, routing_1.handleLocationChange)(routing.routes, routing.basePath, getPathName(), getQueryString(), { onloadEvent: (0, utils_1.isLikelyPageLoad)() });
335
+ const result = (0, routing_1.handleLocationChange)(routing.routes, routing.basePath, getPathName(), getQueryString(), { ...initialMeta, onloadEvent: (0, utils_1.isLikelyPageLoad)() });
334
336
  if (result) {
335
337
  setActiveRouteEvents(result.events);
336
338
  setActiveRoute({ ...result.matchedRoute });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@koordinates/xstate-tree",
3
3
  "main": "lib/index.js",
4
4
  "types": "lib/xstate-tree.d.ts",
5
- "version": "4.3.0-beta.6",
5
+ "version": "4.3.0-beta.8",
6
6
  "license": "MIT",
7
7
  "description": "Build UIs with Actors using xstate and React",
8
8
  "keywords": [