d2aura 23.0.29 → 23.0.30
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { LocationState } from "history";
|
|
2
2
|
interface Props {
|
|
3
|
-
onLocationChanged
|
|
3
|
+
onLocationChanged?<S = LocationState>(location: S): void;
|
|
4
4
|
onParamsChanged?<Params extends {
|
|
5
5
|
[K in keyof Params]?: string;
|
|
6
6
|
} = {}>(params: Params): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routeChangeListener.js","sourceRoot":"","sources":["../../../coreui/routeChangeListener.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"routeChangeListener.js","sourceRoot":"","sources":["../../../coreui/routeChangeListener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,WAAW,EAAE,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAQxD,MAAM,mBAAmB,GAAG,CAAC,KAAY,EAAE,EAAE;IACzC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,SAAS,CAAC,GAAG,EAAE;QACX,KAAK,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,SAAS,CAAC,GAAG,EAAE;QACX,KAAK,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import {useEffect} from 'react';\r\nimport {useLocation, useParams} from 'react-router-dom';\r\nimport {LocationState} from \"history\";\r\n\r\ninterface Props {\r\n onLocationChanged?<S = LocationState>(location: S): void\r\n onParamsChanged?<Params extends { [K in keyof Params]?: string } = {}>(params: Params): void\r\n}\r\n\r\nconst RouteChangeListener = (props: Props) => {\r\n const location = useLocation();\r\n const params = useParams();\r\n\r\n useEffect(() => {\r\n props.onLocationChanged?.(location);\r\n }, [location]);\r\n\r\n useEffect(() => {\r\n props.onParamsChanged?.(params);\r\n }, [params]);\r\n\r\n return null; // This component doesn't render anything\r\n};\r\n\r\nexport default RouteChangeListener;\r\n"]}
|