Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Raw React `navigated` action
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