Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds recipe for adding React Router (v4) to README template #887

Closed
wants to merge 2 commits into from

Conversation

joelhooks
Copy link

Addresses issue #641 by adding React Router recipe to the README files as appropriate.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@@ -409,6 +410,18 @@ import { Navbar, Jumbotron, Button } from 'react-bootstrap';

Now you are ready to use the imported React Bootstrap components within your component hierarchy defined in the render method. Here is an example [`App.js`](https://gist.githubusercontent.com/gaearon/85d8c067f6af1e56277c82d19fd4da7b/raw/6158dd991b67284e9fc8d70b9d973efe87659d72/App.js) redone using React Bootstrap.

## Adding React Router

React Router is a popular solution for adding routing capabilities to your single-page applications. If your app needs routing, you can configure React Router to work with Create React app by following these steps:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the word 'app' should start with a capital letter when 'Create React App' is mentioned

@Calyhre
Copy link

Calyhre commented Dec 18, 2016

I would just add that in order for all links to work, you have to provide the basename attribute for the BrowserRouter component.
It can be done like this:

<BrowserRouter basename={process.env.PUBLIC_URL}>
...
</BrowserRouter>

@gaearon
Copy link
Contributor

gaearon commented Feb 11, 2017

Probably going to wait on this until RR4 hits stable.

@joelhooks joelhooks closed this Apr 23, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants