5 ms·
React.createClass if you want mixins, automatic binding of "this.handleWhatever" methods, and Hot Module Replacement. ES6 Classes if neither of these are a big
by ericclemmons 11y ago
React.createClass if you want mixins, automatic binding of "this.handleWhatever" methods, and Hot Module Replacement.
ES6 Classes if neither of these are a big deal to you, but you prefer classes and still want HMR.
Functional components of you want terse, testable, potentially vdom-agnostic UI components despite losing HMR capabilities (as of yet).
- insin 11y agoIs the issue with functional components that they blow away the state of any stateful components they contain with HMR? If you install and run this Gist mini-project, you still get the HMR experience with the functional component: https://gist.github.com/insin/02103c862ed3622f8b8b#file-readme-md https://gist.github.com/insin/02103c862ed3622f8b8b#file-read...