-
Notifications
You must be signed in to change notification settings - Fork 2
/
MemoryRouter.hx
49 lines (40 loc) · 1.14 KB
/
MemoryRouter.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
package react.router;
import haxe.extern.EitherType;
import history.Location;
import react.ReactComponent;
typedef MemoryRouterProps = {
/**
An array of locations in the history stack.
*/
@:optional var initialEntries:Array<EitherType<String, Location>>;
/**
The initial location’s index in the array of initialEntries.
*/
@:optional var initialIndex:Int;
/**
A function to use to confirm navigation. Defaults to using
window.confirm.
*/
@:optional var getUserConfirmation:String->(Bool->Void)->Void;
/**
The length of location.key. Defaults to 6.
*/
@:optional var keyLength:Int;
/**
If using `react` < 16 or `react-router` < 4.4.0, a single child element
to render.
*/
#if react_next
var children:ReactFragment;
#else
var children:ReactElement;
#end
}
/**
A <Router> that keeps the history of your “URL” in memory (does not read or
write to the address bar). Useful in tests and non-browser environments like
React Native.
See https://reacttraining.com/react-router/web/api/MemoryRouter
*/
@:jsRequire('react-router', 'MemoryRouter')
extern class MemoryRouter extends ReactComponentOfProps<MemoryRouterProps> {}