mobx-route 0.0.64 → 0.0.65

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobx-route",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "keywords": [
5
5
  "mobx",
6
6
  "react",
@@ -11,6 +11,8 @@ export type LinkProps<TRoute extends AnyRoute> = Omit<AnchorHTMLAttributes<HTMLA
11
11
  params: ExtractPathParams<TRoute['path']>;
12
12
  })) | {
13
13
  to: string;
14
+ } | {
15
+ href: string;
14
16
  });
15
17
  type LinkComponentType = <TRoute extends AnyRoute>(props: LinkProps<TRoute>) => ReactNode;
16
18
  export declare const Link: LinkComponentType;
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/react/components/link.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EAKpB,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,qBAAqB,EAAa,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,SAAS,CAAC,MAAM,SAAS,QAAQ,IAAI,IAAI,CACnD,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,MAAM,CACP,GAAG;IACF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,mBAAmB,GACrB,CACI,CAAC;IACC,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,IAAI,GACtE;IAEE,MAAM,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;CAC/D,GACD;IAAE,MAAM,EAAE,iBAAiB,CAAC,MA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M,CAAC,KACrB,SAAS,CAAC;AAEf,eAAO,MAAM,IAAI,EA0DD,iBAAiB,CAAC"}
@@ -2,8 +2,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  /* eslint-disable @typescript-eslint/ban-ts-comment */
3
3
  import { observer } from 'mobx-react-lite';
4
4
  import { cloneElement, forwardRef, isValidElement, } from 'react';
5
- export const Link = observer(forwardRef(({ to, asChild, query, replace, children, params, ...anchorProps }, ref) => {
6
- const href = typeof to === 'string' ? to : to.createUrl(params, query);
5
+ export const Link = observer(forwardRef(({ to, href: outerHref, asChild, query, replace, children, params, ...anchorProps }, ref) => {
6
+ const href = outerHref ??
7
+ (typeof to === 'string'
8
+ ? to
9
+ : to.createUrl(params, query));
7
10
  const handleClick = (event) => {
8
11
  if (event.ctrlKey ||
9
12
  event.metaKey ||