useMatchPattern
declare function useMatchPattern(): boolean;
The useMatchPattern hook returns true when the current path matches the provided pattern.
import { useMatchPattern } from '@archibald/core';
function App() {
const active = useMatchPattern('p/:productId(\\d+)');
console.log(`Page based on pattern is active ${active}`);
return;
}