the name of the state to check. Relative state names such as '.child' are supported. Relative states are resolved relative to the state that rendered the hook.
if present, the hook will only return true if all the provided parameter values match.
when true, the hook returns true only when the state matches exactly. when false, returns true if the state matches, or any child state matches.
Generated using TypeDoc
A hook that returns true if a given state is active.
Example:
function ContactsLabel() { const isActive = useIsActive('contacts'); return <span className={isActive ? 'active' : 'inactive'}>Contacts></span> }
Example:
function JoeLabel() { const isActive = useIsActive('contacts.contact', { contactId: 'joe' }); return <span className={isActive ? 'active' : 'inactive'}>Joe></span> }