Skip to content

Commit 14af00b

Browse files
committed
Added support for React Router v6
I implemented Navigate and Routes for developers that are using v6 of React Router since Switch and Redirect were replaced.
1 parent 2cab034 commit 14af00b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/react/router/Navigate.hx

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

src/react/router/Routes.hx

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

0 commit comments

Comments
 (0)