@solidjs/router
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -1,2 +0,2 @@ | ||
import { isServer, createComponent as createComponent$1, mergeProps as mergeProps$1, spread, insert, effect, setAttribute, template } from 'solid-js/web'; | ||
import { isServer, delegateEvents, createComponent as createComponent$1, mergeProps as mergeProps$1, spread, insert, effect, setAttribute, template } from 'solid-js/web'; | ||
import { createSignal, onCleanup, runWithOwner, createMemo, getOwner, createContext, useContext, untrack, useTransition, on, resetErrorBoundaries, createRenderEffect, createComponent, children, createRoot, Show, mergeProps, splitProps } from 'solid-js'; | ||
@@ -653,4 +653,6 @@ | ||
}); | ||
} | ||
} // ensure delegated events run first | ||
delegateEvents(["click"]); | ||
document.addEventListener("click", handleAnchorClick); | ||
@@ -657,0 +659,0 @@ onCleanup(() => document.removeEventListener("click", handleAnchorClick)); |
import { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, useTransition, resetErrorBoundaries } from "solid-js"; | ||
import { isServer } from "solid-js/web"; | ||
import { isServer, delegateEvents } from "solid-js/web"; | ||
import { normalizeIntegration } from "./integration"; | ||
@@ -334,2 +334,4 @@ import { createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, urlDecode, expandOptionals } from "./utils"; | ||
} | ||
// ensure delegated events run first | ||
delegateEvents(["click"]); | ||
document.addEventListener("click", handleAnchorClick); | ||
@@ -336,0 +338,0 @@ onCleanup(() => document.removeEventListener("click", handleAnchorClick)); |
@@ -36,4 +36,4 @@ import { Component, JSX } from "solid-js"; | ||
} | ||
export interface RouteDataFuncArgs { | ||
data: unknown; | ||
export interface RouteDataFuncArgs<T = unknown> { | ||
data: T extends RouteDataFunc ? ReturnType<T> : T; | ||
params: Params; | ||
@@ -43,3 +43,3 @@ location: Location; | ||
} | ||
export declare type RouteDataFunc<T = unknown> = (args: RouteDataFuncArgs) => T; | ||
export declare type RouteDataFunc<T = unknown, R = unknown> = (args: RouteDataFuncArgs<T>) => R; | ||
export declare type RouteDefinition = { | ||
@@ -46,0 +46,0 @@ path: string | string[]; |
@@ -9,3 +9,3 @@ { | ||
"license": "MIT", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"homepage": "https://github.com/solidjs/solid-router#readme", | ||
@@ -12,0 +12,0 @@ "repository": { |
@@ -5,5 +5,2 @@ <p> | ||
> 0.3.x only works with Solid v1.3.5 or later. | ||
> `useData` has been renamed to `useRouteData` and no longer takes arguments. Refer to documentation below. | ||
# Solid Router [![npm Version](https://img.shields.io/npm/v/@solidjs/router.svg?style=flat-square)](https://www.npmjs.org/package/@solidjs/router) | ||
@@ -10,0 +7,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84386
1772
555