Skip to content

Instantly share code, notes, and snippets.

View CharlesMangwa's full-sized avatar
🤔
Dabbling with Widgets...

Carlito CharlesMangwa

🤔
Dabbling with Widgets...
View GitHub Profile
@CharlesMangwa
CharlesMangwa / Root.js
Last active September 12, 2018 03:43
Main navigation sample with React Router Navigation
import React from 'react'
import { Card, Navigation } from 'react-router-navigation'
import App from '@scenes/App'
import Auth from '@scenes/Auth'
import Launch from '@scenes/Launch'
import Welcome from '@scenes/Welcome'
const Root = () => (
<Navigation hideNavBar>
function objectEquals(x, y) {
'use strict';
if (x === null || x === undefined || y === null || y === undefined) { return x === y; }
// after this just checking type of one would be enough
if (x.constructor !== y.constructor) { return false; }
// if they are functions, they should exactly refer to same one (because of closures)
if (x instanceof Function) { return x === y; }
// if they are regexps, they should exactly refer to same one (it is hard to better equality check on current ES)
if (x instanceof RegExp) { return x === y; }
import React from 'react'
import { Router, Route, Link } from 'react-router'
const App = React.createClass({/*...*/})
const About = React.createClass({/*...*/})
// etc.
const Users = React.createClass({
render() {
return (