Created
July 5, 2019 16:13
-
-
Save fredrivett/eca90ed54022c6fbae45cc41f0a73dc1 to your computer and use it in GitHub Desktop.
Authenticated Routing with React, React Router, Hooks, Redux & TypeScript
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
import * as React from "react"; | |
import { Route, Router } from "react-router-dom"; | |
import history from "./history"; | |
import Nav from "./components/Nav"; | |
import Pages from "./routes/Pages"; | |
const App = () => ( | |
<div className="App"> | |
<Router history={history}> | |
<Nav /> | |
<Route component={Pages} /> | |
</Router> | |
</div> | |
); | |
export default App; |
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
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import { Provider } from "react-redux"; | |
import { applyMiddleware, compose, createStore } from "redux"; | |
import thunkMiddleware from "redux-thunk-recursion-detect"; | |
import "./index.css"; | |
import App from "./App"; | |
import currentReducer from "./reducers/current"; | |
import * as serviceWorker from "./serviceWorker"; | |
ReactDOM.render( | |
<App />, | |
document.getElementById('root') | |
); | |
serviceWorker.unregister(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment