Home / Admin / om-nextjs14.js
Duplicate Snippet

Embed Snippet on Your Site

om-nextjs14.js

Code Preview
js
'use client';
import { usePathname } from 'next/navigation';
import { useEffect, useState } from 'react';
export function RouteChangeListener() {
  const pathname = usePathname();
  const [changes, setChanges] = useState(0);
  useEffect(() => {
    if (window.om5678_1234) {
        window.om5678_1234.reset();
    }
    setChanges((prev) => prev + 1);
  }, [pathname]);
  return <></>;
}

Comments

Add a Comment