You can convert js-code like this:
var a = '1',
b,
c = '2';
into
import HomePage from './HomePage.jsx'; | |
import AboutPage from './AboutPage.jsx'; | |
import UserPage from './UserPage.jsx'; | |
import FourOhFourPage from './FourOhFourPage.jsx'; | |
const PAGES = { | |
home: HomePage, | |
about: AboutPage, | |
user: UserPage, | |
}; |
class SignInModal extends Component { | |
componentDidMount() { | |
this.InputComponent.focus(); | |
} | |
render() { | |
return ( | |
<div> | |
<label>User name: </label> | |
<Input |
class Input extends Component { | |
focus() { | |
this.el.focus(); | |
} | |
render() { | |
return ( | |
<input | |
ref={el=> { this.el = el; }} | |
/> |
You can convert js-code like this:
var a = '1',
b,
c = '2';
into
Name of thing | Sorta like... | Mounted? | Can you even setState? | What would you say... ya do here? |
---|---|---|---|---|
constructor | initialize() | nope | nope | init stuff NO side effects |
componentWillMount | beforeDomReady() | nope | yeah but don't | Only needed in createClass now use constructor for most things |
render | render | nope | please no | render stuff and don't set any state please |
componentDidMount | domReady() | yup | yup | DOM is a go init jQuery plugins dispatch stuff |
componentWillReceiveProps | onChange() | yup | yup |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/home/div/.oh-my-zsh" | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. |
// originally implemented as a mixin, | |
// taken from https://gist.github.com/joshma/6753333dd38a6010f9a6#file-whydidyouupdatemixin-js | |
// modified to make a higher-order component | |
/* eslint-disable no-console */ | |
import _ from 'underscore'; | |
import React, { Component, PureComponent } from 'react'; | |
function isRequiredUpdateObject(o) { | |
return Array.isArray(o) || (o && o.constructor === Object.prototype.constructor); |
function injectGitFileStatus() | |
{ | |
const timeout = 5000; | |
const addedColor = "#8dc149"; | |
const modifiedColor = "#cbcb41"; | |
const stagedColor = "#ca2820"; | |
const ignoredOpacity = "0.4"; | |
const explorer = document.getElementById("workbench.view.explorer"); | |
if (explorer) |
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// Choose either "stable" for receiving highly polished, | |
// or "canary" for less polished but more frequent updates | |
updateChannel: 'canary', |
dialog { | |
position: fixed; | |
top: 50%; | |
left: 50%; | |
right: auto; | |
padding: 30px; | |
transform: perspective(500px) translate(-50%, -50%); | |
background: linear-gradient(to bottom, #FFF, #F4F4F4) #FFF; | |
border: none; | |
border-radius: 3px; |