Functional vs Class-Components in React

David Jöch
Jul 11, 2018 · 3 min read
function Welcome(props) {
return <h1>Hello, {}</h1>;
class Welcome extends React.Component {
render() {
return <h1>Hello, {}</h1>;

Differences between functional and class-Components


As functional component transpiled by Babel
The exact same component written as class component transpiled with Babel


Lifecycle Hooks

So why should I use functional components at all?


Further readings

David Jöch

Written by

Frontend Engineer 💻 Musician 🎹

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade