Created
March 6, 2017 02:09
-
-
Save azamsharp/77b5c2980fe066249d66c6a8415bab2d to your computer and use it in GitHub Desktop.
React Router Issue
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
<html> | |
<head> | |
<script src="https://unpkg.com/react@15/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script> | |
<script src="https://npmcdn.com/react-router/umd/ReactRouter.min.js"></script> | |
</head> | |
<body> | |
<div id="container"></div> | |
<script type="text/babel"> | |
var container = document.querySelector("#container"); | |
var App = React.createClass({ | |
componentWillMount: function() { | |
}, | |
render: function() { | |
return ( | |
<div> | |
<h1>My App</h1> | |
<ul> | |
<li>Home</li> | |
<li>Stuff</li> | |
<li>Contact</li> | |
</ul> | |
<div> | |
content | |
</div> | |
</div> | |
); | |
} | |
}); | |
ReactDOM.render( | |
<ReactRouter.Router> | |
<ReactRouter.Route path="/" component={App}> | |
</ReactRouter.Route> | |
</ReactRouter.Router>, | |
container | |
); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment