mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
using hash router with custom history instance
This commit is contained in:
parent
17cc5a2361
commit
aa19a2d804
1 changed files with 10 additions and 3 deletions
|
|
@ -1,19 +1,26 @@
|
|||
import React, { PureComponent } from 'react';
|
||||
import { HashRouter, Switch, Route, Redirect } from 'react-router-dom';
|
||||
import { Router, Switch, Route, Redirect } from 'react-router-dom';
|
||||
import { createHashHistory } from 'history';
|
||||
import { Main, Addons } from 'stremio-routes';
|
||||
import styles from './styles';
|
||||
|
||||
class App extends PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.history = createHashHistory();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className={styles['app']}>
|
||||
<HashRouter>
|
||||
<Router history={this.history}>
|
||||
<Switch>
|
||||
<Route path={'/(discover|library|calendar|search)?'} exact={true} component={Main} />
|
||||
<Route path={'/addons'} component={Addons} />
|
||||
<Redirect to={'/'} />
|
||||
</Switch>
|
||||
</HashRouter>
|
||||
</Router>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue