5 ms·
Looks like they've just added first-class support for that pattern, so you get propTypes, defaultProps, etc.
by epmatsw 11y ago
Looks like they've just added first-class support for that pattern, so you get propTypes, defaultProps, etc.
- danabramov 11y agoAlso in the future this pattern will be faster thanks to React not having to maintain an internal instance for such components. (How's that different from just a function? It shows up as separate thing in React DevTools, it can have default props or, in the future, shouldComponentUpdate (or built-in memoization strategy?), you can potentially later change it to be stateful without rewriting consuming code, etc)