Skip to content

Commit bbff969

Browse files
committed
Usable for versions 4.0.0 and above
1 parent 16c3cc8 commit bbff969

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

src/react/router/BrowserRouter.hx

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package src.react.router;
2+
3+
/*
4+
* Avaliable for versions 4.0.0 and above
5+
*/
6+
7+
#if (jsImport)
8+
@:js.import('react-router-dom', 'BrowserRouter')
9+
#else
10+
@:jsRequire('react-router-dom', 'BrowserRouter')
11+
#end
12+
extern class BrowserRouter extends react.ReactComponent {}

src/react/router/HashRouter.hx

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package src.react.router;
2+
3+
/*
4+
* Avaliable for versions 4.0.0 and above
5+
*/
6+
7+
#if (jsImport)
8+
@:js.import('react-router-dom', 'HashRouter')
9+
#else
10+
@:jsRequire('react-router-dom', 'HashRouter')
11+
#end
12+
extern class HashRouter extends react.ReactComponent {}

src/react/router/Statics.hx

+3
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ extern class Statics {
1111
static public var hashHistory:HashHistory;
1212
static public var browserHistory:BrowserHistory;
1313
static public var withRouter:Dynamic->Dynamic;
14+
15+
static public function useLocation<T>():T; // Avaliable for versions 4.0.0 and above
16+
static public function useHistory<T>():T; // Avaliable for versions 4.0.0 and above
1417
}

0 commit comments

Comments
 (0)