Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 350 Bytes

File metadata and controls

12 lines (9 loc) · 350 Bytes
title useMatch

useMatch takes an accessor that returns the path and creates a Memo that returns match information if the current path matches the provided path. Useful for determining if a given path matches the current route.

const match = useMatch(() => props.href);

return <div classList={{ active: Boolean(match()) }} />;