Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Docs for react-router v4 basename feature
Fix #2593
  • Loading branch information
viankakrisna authored Jun 28, 2017
commit 665f5ed6d57848610c43b40995707966378bc2da
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 `[email protected]` and higher.
Expand Down