Routify exact path for using isActive?

469 views Asked by At

I'm building a restaurant review site using Svelte and Routify, I have a path "./reviews" that shows the current user's own reviews, and paths for reviews on different categories of restaurants, i.e. "./reviews/mexican" or "./reviews/asian", when the I click on the Mexican's tab, both the "./reviews" and "./reviews/mexican" seem to get turned on as isActive, how do I set exact paths in Routify?

Thanks!

1

There are 1 answers

0
JakeDK On

This should work

$isActive('/path/to/component', { /* params */ }, { strict: true})

With strict set to false, the path would default to /path/to/component/index and thus wouldn't match any descendent components.

https://routify.dev/docs/helpers#is-active