mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-25 23:05:23 +00:00
Fix TS
This commit is contained in:
@@ -16,17 +16,21 @@ import Script from 'next/script';
|
||||
const EmptyAppShell: React.FC = ({children}) => <>{children}</>;
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
// @ts-ignore
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
// @ts-ignore
|
||||
window.gtag = function () {
|
||||
dataLayer.push(arguments);
|
||||
// @ts-ignore
|
||||
window.dataLayer.push(arguments);
|
||||
};
|
||||
// @ts-ignore
|
||||
gtag('js', new Date());
|
||||
}
|
||||
|
||||
export default function MyApp({Component, pageProps}: AppProps) {
|
||||
const router = useRouter();
|
||||
React.useEffect(() => {
|
||||
const handleRouteChange = (url) => {
|
||||
const handleRouteChange = (url: string) => {
|
||||
// @ts-ignore
|
||||
gtag('config', process.env.NEXT_PUBLIC_GA_TRACKING_ID, {
|
||||
page_path: url,
|
||||
|
||||
Reference in New Issue
Block a user