Skip to content

Commit

Permalink
Docs for react-router v4 basename feature
Browse files Browse the repository at this point in the history
  • Loading branch information
viankakrisna committed Jun 28, 2017
1 parent 76ad76e commit 665f5ed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,15 @@ To override this, specify the `homepage` in your `package.json`, for example:
This will let Create React App correctly infer the root path to use in the generated HTML file.
If you are using react-router v4 for your client side routing, it supports `basename` config in the `BrowserRouter`. For example:
```js
<BrowserRouter basename="/calendar"/>
<Link to="/today"/> // renders <a href="/calendar/today">
```
So, all the `Link` component inside your app will navigate properly. Learn more [here](https://reacttraining.com/react-router/web/api/BrowserRouter/basename-string)
#### Serving the Same Build from Different Paths
>Note: this feature is available with `react-scripts@0.9.0` and higher.
Expand Down

0 comments on commit 665f5ed

Please sign in to comment.