Skip to content

Instantly share code, notes, and snippets.

@jamesknelson
Created October 5, 2015 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesknelson/d18cbc97aeca53675b4e to your computer and use it in GitHub Desktop.
Save jamesknelson/d18cbc97aeca53675b4e to your computer and use it in GitHub Desktop.
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