Skip to content

Commit

Permalink
Merge pull request #56 from unitof/fix-possiblynull
Browse files Browse the repository at this point in the history
Avoid `Type error: 'searchParams' is possibly 'null'.` in example code
  • Loading branch information
derrickreimer authored May 23, 2024
2 parents 343d474 + 67a6eb3 commit 7a9b528
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ function TrackPageView() {
if (!pathname) return;

trackPageview({
url: pathname + searchParams.toString(),
url: pathname + searchParams?.toString(),
referrer: document.referrer
});
}, [pathname, searchParams]);
Expand Down Expand Up @@ -306,7 +306,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
<head></head>
<body>
<Fathom />
<Page>{children}</Page>
{children}
</body>
</html>
);
Expand Down

0 comments on commit 7a9b528

Please sign in to comment.