native-document 1.0.85 → 1.0.87

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.
@@ -6,13 +6,13 @@ import RouterError from "./errors/RouterError";
6
6
 
7
7
  export function Link(options, children){
8
8
  const { to, href, ...attributes } = options;
9
- const target = to || href;
10
- if(Validator.isString(target)) {
9
+ if(href) {
11
10
  const router = Router.get();
12
- return NativeLink({ ...attributes, href: target}, children).nd.onPreventClick(() => {
13
- router.push(target);
11
+ return NativeLink({ ...attributes, href}, children).nd.onPreventClick(() => {
12
+ router.push(href);
14
13
  });
15
14
  }
15
+ const target = typeof to === 'string' ? { name: to } : to;
16
16
  const routerName = target.router || DEFAULT_ROUTER_NAME;
17
17
  const router = Router.get(routerName);
18
18
  if(!router) {