-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Web frontend: Reverted: trying to introduce redux and server-side pre…
…rendering
- Loading branch information
1 parent
408b5a6
commit 9abde3b
Showing
19 changed files
with
104 additions
and
488 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import './css/site.css'; | ||
import 'bootstrap'; | ||
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
import { AppContainer } from 'react-hot-loader'; | ||
import { BrowserRouter } from 'react-router-dom'; | ||
import * as RoutesModule from './routes'; | ||
let routes = RoutesModule.routes; | ||
|
||
function renderApp() { | ||
// This code starts up the React app when it runs in a browser. It sets up the routing | ||
// configuration and injects the app into a DOM element. | ||
const baseUrl = document.getElementsByTagName('base')[0].getAttribute('href')!; | ||
ReactDOM.render( | ||
<AppContainer> | ||
<BrowserRouter children={ routes } basename={ baseUrl } /> | ||
</AppContainer>, | ||
document.getElementById('react-app') | ||
); | ||
} | ||
|
||
renderApp(); | ||
|
||
// Allow Hot Module Replacement | ||
if (module.hot) { | ||
module.hot.accept('./routes', () => { | ||
routes = require<typeof RoutesModule>('./routes').routes; | ||
renderApp(); | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.