Last active
August 14, 2020 10:05
-
-
Save stephane777/5601dc9c3325f8041ef1bb49903b429b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ### OPEN Webpack.config.js | |
| Without this the browser will say :"I don't have instruction on how to handle the url with the query string!" | |
| The modification will be redirected to the index.html page and then React Router can handle the change and send the right Route. | |
| output :{ | |
| publicPath: '/' | |
| } | |
| devServer :{ | |
| historyApiFallback: true | |
| } | |
| ### Extract of compile log when running npm start | |
| 「wds」: Project is running at http://localhost:8080/ | |
| 「wds」: webpack output is served from / | |
| 「wds」: Content not from webpack is served from /Users/steph08/Documents/Documents - Steph07's MacBook Pro/Tyler McGinnis/React/Hacker-News | |
| 「wds」: 404s will fallback to /index.html | |
| 「wdm」: wait until bundle finished: / | |
| 「wdm」: Hash: 89d19e8bb9e62da2c26a | |
| import { BrowserRouter as Router, Route } from "react-router-dom"; | |
| ## Passing props to a Route component | |
| <Route | |
| path='/' | |
| render={(props)=> <Component {...props} propsTopass={propsTopass}>}> | |
| </Route |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment