Raw React `navigated` action
This file contains 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
function navigated() { | |
// Choose which component to render based on browser URL | |
var component = window.location.hash == "#/" | |
? React.createElement('div', {}, "Index Page") | |
: React.createElement('div', {}, "Not Found") | |
// Render the new component to the page's #react-app element | |
ReactDOM.render( | |
component, | |
document.getElementById('react-app') | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment