Created
January 4, 2021 16:51
-
-
Save brlafreniere/171b062d192be7aeb6e0b842a3523110 to your computer and use it in GitHub Desktop.
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 { Route, Switch } from 'react-router-dom' | |
import Home from "./Home" | |
import Navigation from "./Navigation" | |
import Quizzer from "./Quizzer" | |
import Admin from "./Admin" | |
import Login from "./Login" | |
import Logout from "./Logout" | |
import { CookiesProvider } from 'react-cookie'; | |
const App = function(props) { | |
return ( | |
<> | |
<CookiesProvider> | |
<Navigation /> | |
<Switch> | |
<Route exact path="/" component={Home} /> | |
<Route exact path="/quizzer" component={Quizzer} /> | |
<Route path="/admin" component={Admin} /> | |
<Route exact path="/login" component={Login} /> | |
<Route exact path="/logout" component={Logout} /> | |
</Switch> | |
</CookiesProvider> | |
</> | |
) | |
} | |
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
// Run this example by adding <%= javascript_pack_tag 'hello_react' %> to the head of your layout file, | |
// like app/views/layouts/application.html.erb. All it does is render <div>Hello React</div> at the bottom | |
// of the page. | |
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import App from "../components/App" | |
import { BrowserRouter as Router, Route} from 'react-router-dom' | |
document.addEventListener('DOMContentLoaded', () => { | |
ReactDOM.render( | |
<Router> | |
<Route path="/" component={App} /> | |
</Router>, | |
document.body.appendChild(document.createElement('div')), | |
) | |
}) |
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
Uncaught TypeError: cookies.get is not a function | |
at Navigation (Navigation.js:10) | |
at renderWithHooks (react-dom.development.js:14972) | |
at mountIndeterminateComponent (react-dom.development.js:17734) | |
at beginWork (react-dom.development.js:18935) | |
at HTMLUnknownElement.callCallback (react-dom.development.js:3922) | |
at Object.invokeGuardedCallbackDev (react-dom.development.js:3971) | |
at invokeGuardedCallback (react-dom.development.js:4031) | |
at beginWork$1 (react-dom.development.js:23780) | |
at performUnitOfWork (react-dom.development.js:22616) | |
at workLoopSync (react-dom.development.js:22553) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment