Better HN
topnewbestaskshowjobs
Log inSign up

MindPenguin

6 karma · joined Jul 24, 2016 (10y ago) · 2 submissions

Submissions

comment 10y ago · link · parent

It's not "overriding" lifecycle methods, it's passing lifecycle methods to a component factory function.

comment 10y ago · link · parent

Conceptually, components have state, but it's all managed by react, so you only ever write pure functions. Granted, depending on how you update state in event handlers and lifecycle methods, you will need to think about state a lot, but this is an unavoidable fact of UI programming.

> every component must be created by extending a base class

This is an implementation detail, instead of ES6 classes you can also use React.createClass(), which might as well be named React.createComponent(). These "classes" can't be inherited from.