This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const willUnmount = Symbol('unmount'); | |
function statefulComponent(getInitialState, render, componentWillUnmount = () => void 0) { | |
return function*(props) { | |
const internalId = React.pleaseGiveMeAnInternalId(); | |
const state = getInitialState(props); | |
const setState = (nextState) => { | |
Object.assign(state, nextState); | |
React.pleaseRerenderThisInternalId(internalId); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parser": "babel-eslint", | |
"env": { | |
"es6": true, | |
"mocha": true, | |
"node": true | |
}, | |
"ecmaFeatures": { | |
"blockBindings": true, | |
"forOf": true, |
OlderNewer