Skip to content

Instantly share code, notes, and snippets.

@overthemike
overthemike / App.js
Created May 13, 2017 05:48 — forked from fdidron/App.js
React Router v4 Auth
//Usage
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Route from './AuthRoute';
import Login from './Login';
import Private from './Private';
export default () =>
<Router>
// At a glance you can see which global objects are being imported, these are the local variable names you will use in your script
(function(z, $) { // encapsulate in a closure
// Use strict is within scoped function so that it only applies to this code block
"use strict"; // Prevents common errors and bad practices, by catching them at runtime.
var proto; // The var that will store the reference to the prototype for our widget
/**
* Description of what the widget does
*
* @example
* z.myWidget({