Skip to content

Commit cccd82f

Browse files
committed
refactor: remove end instead of deprecating it
1 parent 5098274 commit cccd82f

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ The `<A>` tag also has an `active` class if its href matches the current locatio
156156
| inactiveClass | string | The class to show when the link is inactive (when the current location doesn't match the link) |
157157
| activeClass | string | The class to show when the link is active, i.e. the current location _starts with_ `href` |
158158
| 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` |
160159

161160
### The Navigate Component
162161
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:

src/components.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@ export interface AnchorProps extends Omit<JSX.AnchorHTMLAttributes<HTMLAnchorEle
209209
inactiveClass?: string;
210210
activeClass?: string;
211211
exactActiveClass?: string;
212-
/**
213-
* @deprecated end property deprecated in favor of 'exactActiveClass'
214-
*/
215-
end?: boolean;
216212
}
217213
export function A(props: AnchorProps) {
218214
props = mergeProps({ inactiveClass: "inactive", activeClass: "active", exactActiveClass: 'exactActive' }, props);
@@ -222,8 +218,7 @@ export function A(props: AnchorProps) {
222218
"class",
223219
"activeClass",
224220
"inactiveClass",
225-
"exactActiveClass",
226-
"end"
221+
"exactActiveClass"
227222
]);
228223
const to = useResolvedPath(() => props.href);
229224
const href = useHref(to);
@@ -233,8 +228,7 @@ export function A(props: AnchorProps) {
233228
if (to_ === undefined) return [false, false];
234229
const path = normalizePath(to_.split(/[?#]/, 1)[0]).toLowerCase();
235230
const loc = normalizePath(location.pathname).toLowerCase();
236-
// To be replaced with [loc.startsWith(path), path === loc] when end is patched out
237-
return [props.end ? path === loc : loc.startsWith(path), path === loc];
231+
return [loc.startsWith(path), path === loc];
238232
});
239233

240234
return (

0 commit comments

Comments
 (0)