React & ES6 class-based inheritance

I’ve noticed how a lot of developers are discussing the React way, which is functional. I know for a fact functional programming favors composition over inheritance, since classes has a tendency to ‘hide away’ properties with encapsulation.
Functions obviously also provide closures, but I’m still confused as to why there’s a pattern of class-based inheritance in a lot of React component examples

Shouldn’t this be considered an anti-pattern, as it adheres to OOP?