-
Notifications
You must be signed in to change notification settings - Fork 1
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
React-router #32
Comments
React Router TutorialInstallation Steps
Navigate to app.js or route js fileimport {Router, Route, hashHistory} from 'react-router' //es6 var Router = require('react-router').Router //es5
var Route = require('react-router').Route //es5
var hashHistory = require('react-router').hashHistory //es5 Inside the app.js render method, replace your exisiting component with the Router component as such:- <Router history={hashHistory}>
<Route path="/" component={App}/>
</Router> Add another RouteAdd additional components for which you want to add routes for about.jsx
contact.jsx <Route path="/about" component={about}/>
<Route path="/contact" component={contact}/> Now visit Navigate with LinkAdd a link to an import {Link} from 'react-router' //es6 var Link = require('react-router').Link //es5 Now add a <h2><Link to="/about">About</Link><h2> Your *###### You cannot pass down a string, you have to pass an object with pathname as found in example: - http://stackoverflow.com/questions/30115324/pass-props-in-link-react-router Nested Routes |
installs react router and documents problem with link #32
added router and the link to the button see #32
No description provided.
The text was updated successfully, but these errors were encountered: