You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,7 @@ export default function App() {
144
144
}
145
145
```
146
146
147
-
The `<A>` tag also has an `active` class if its href matches the current location, an `exactActive` class if its href matches the current location exactly and `inactive` class otherwise. **Note:**`active` and `exactActive`are mutually exclusive - there is no class merging! By default matching includes locations that are descendents (eg. href `/users` matches locations `/users` and `/users/123`). `exactActive` is particularly useful for links to the root route `/` which would match everything.
147
+
The `<A>` tag also has an `active` class if its href matches the current location and `inactive` class otherwise. By providing the property `exactActiveClass`, you can opt in to a third state, which is `exactActive`and is set when the href matches the current location exactly. **Note:**By default matching includes locations that are descendents (eg. href `/users` matches locations `/users` and `/users/123`). If no `exactActiveClass` property was provided, `active` class will be set for both partially and exactly matching routes.
148
148
149
149
150
150
| prop | type | description |
@@ -155,8 +155,8 @@ The `<A>` tag also has an `active` class if its href matches the current locatio
155
155
| state | unknown |[Push this value](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState) to the history stack when navigating ||
156
156
| inactiveClass | string | The class to show when the link is inactive (when the current location doesn't match the link) |
157
157
| activeClass | string | The class to show when the link is active, i.e. the current location _starts with_`href`|
158
-
| exactActiveClass | string | The class to show when the link matches the `href` exactly|
159
-
| end | boolean | If `true`, only considers the link to be active when the curent location matches the `href` exactly; if `false`, check if the current location _starts with_`href`|
158
+
| exactActiveClass | string or true | The class to show when the link matches the `href` exactly. If `true`, applies `exactActive` class and enables strict matching - i.e. `activeClass` will not apply for an exact match.
159
+
| end | boolean |**Deprecated**If `true`, only considers the link to be active when the curent location matches the `href` exactly; if `false`, check if the current location _starts with_`href` - providing `exactActiveClass` overrides this behavior ||
160
160
161
161
### The Navigate Component
162
162
Solid Router provides a `Navigate` component that works similarly to `A`, but it will _immediately_ navigate to the provided path as soon as the component is rendered. It also uses the `href` prop, but you have the additional option of passing a function to `href` that returns a path to navigate to:
0 commit comments