forked from aidenybai/react-scan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(monitor): Astro Monitoring component props (aidenybai#116)
- fix typo - Replaced individual props with MonitoringWithoutRouteProps type for better type safety. - Removed unused variables and imports to clean up the code. - Updated AstroMonitor component to spread props, enhancing flexibility and maintainability.
- Loading branch information
Showing
2 changed files
with
13 additions
and
14 deletions.
There are no files selected for viewing
10 changes: 3 additions & 7 deletions
10
packages/scan/src/core/monitor/params/astro/Monitoring.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
--- | ||
import type { MonitoringWithoutRouteProps } from '../..'; | ||
// @ts-ignore This file will not be packaged, so the file to be imported should be a .mjs file. | ||
import { AstroMonitor } from './component.mjs'; | ||
interface Props { | ||
url?: string; | ||
apiKey: string; | ||
} | ||
const { apiKey, url } = Astro.props; | ||
type Props = MonitoringWithoutRouteProps; | ||
const path = Astro.url.pathname; | ||
const params = Astro.params; | ||
--- | ||
|
||
<AstroMonitor apiKey={apiKey} url={url} path={pathname} params={params} client:only="react" /> | ||
<AstroMonitor path={path} params={params} {...Astro.props} client:only="react" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters