solid-navigator 0.3.0 → 0.3.1

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/dist/dev.js CHANGED
@@ -347,12 +347,13 @@ var Route = (props) => {
347
347
  };
348
348
  var matchComponent = (name) => {
349
349
  const context = useRouterContext();
350
+ const matched = () => context.matched();
350
351
  const component = createMemo(() => {
351
- const components = context.matched()?.route.components || context.matched()?.route.mergedComponents || {};
352
+ const components = matched()?.route.components || matched()?.route.mergedComponents || {};
352
353
  return components[name()];
353
354
  });
354
355
  return createMemo(() => {
355
- return component()();
356
+ return component();
356
357
  });
357
358
  };
358
359
  var _tmpl$ = /* @__PURE__ */ template(`<a sn-link>`);
package/dist/dev.jsx CHANGED
@@ -357,11 +357,11 @@ var matchComponent = (name) => {
357
357
  const context = useRouterContext();
358
358
  const matched = () => context.matched();
359
359
  const component = createMemo4(() => {
360
- const components = context.matched()?.route.components || context.matched()?.route.mergedComponents || {};
360
+ const components = matched()?.route.components || matched()?.route.mergedComponents || {};
361
361
  return components[name()];
362
362
  });
363
363
  return createMemo4(() => {
364
- return component()();
364
+ return component();
365
365
  });
366
366
  };
367
367
 
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ interface RouteObject {
10
10
  declare const Route: (props: Omit<RouteObject, 'children'> & {
11
11
  children?: JSX.Element;
12
12
  }) => JSX.Element;
13
- declare const matchComponent: (name: () => string) => Component;
13
+ declare const matchComponent: (name: () => string) => () => Component;
14
14
 
15
15
  interface NavigateOptions {
16
16
  replace?: boolean;
package/dist/index.js CHANGED
@@ -343,12 +343,13 @@ var Route = (props) => {
343
343
  };
344
344
  var matchComponent = (name) => {
345
345
  const context = useRouterContext();
346
+ const matched = () => context.matched();
346
347
  const component = createMemo(() => {
347
- const components = context.matched()?.route.components || context.matched()?.route.mergedComponents || {};
348
+ const components = matched()?.route.components || matched()?.route.mergedComponents || {};
348
349
  return components[name()];
349
350
  });
350
351
  return createMemo(() => {
351
- return component()();
352
+ return component();
352
353
  });
353
354
  };
354
355
  var _tmpl$ = /* @__PURE__ */ template(`<a sn-link>`);
package/dist/index.jsx CHANGED
@@ -354,11 +354,11 @@ var matchComponent = (name) => {
354
354
  const context = useRouterContext();
355
355
  const matched = () => context.matched();
356
356
  const component = createMemo4(() => {
357
- const components = context.matched()?.route.components || context.matched()?.route.mergedComponents || {};
357
+ const components = matched()?.route.components || matched()?.route.mergedComponents || {};
358
358
  return components[name()];
359
359
  });
360
360
  return createMemo4(() => {
361
- return component()();
361
+ return component();
362
362
  });
363
363
  };
364
364
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-navigator",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Solid Navigator is a library that is inspired by vue router and solid router.",
5
5
  "license": "MIT",
6
6
  "author": "SupertigerDev",