-
Notifications
You must be signed in to change notification settings - Fork 2
/
NavLink.hx
57 lines (47 loc) · 1.56 KB
/
NavLink.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package react.router;
import history.Location;
import react.ReactComponent;
import react.router.Link.LinkProps;
typedef NavLinkProps = {
> LinkProps,
/**
The class to give the element when it is active. The default given
class is active. This will be joined with the className prop.
*/
@:optional var activeClassName:String;
/**
The styles to apply to the element when it is active.
*/
@:optional var activeStyle:Dynamic;
/**
When true, the active class/style will only be applied if the location
is matched exactly.
*/
@:optional var exact:Bool;
/**
When true, the trailing slash on a location’s pathname will be taken
into consideration when determining if the location matches the current
URL.
See the <Route strict> documentation for more information.
*/
@:optional var strict:Bool;
/**
A function to add extra logic for determining whether the link is
active. This should be used if you want to do more than verify that the
link’s pathname matches the current URL’s pathname.
*/
@:optional var isActive:RouterMatch->Location->Bool;
/**
The isActive compares the current history location (usually the current
browser URL). To compare to a different location, a location can be
passed.
*/
@:optional var location:Location;
}
/**
A special version of the <Link> that will add styling attributes to the
rendered element when it matches the current URL.
See https://reacttraining.com/react-router/web/api/NavLink
*/
@:jsRequire('react-router-dom', 'NavLink')
extern class NavLink extends ReactComponentOfProps<NavLinkProps> {}