Should You Use Functional or Class Components?

What’s a Functional Component?

function Meow(props) {
return (
<div>
{props.cat} says, "Meow"
</div>
)
}
//or, using the arrow functions introduced in ES6const Meow = (props) => {
return (
<div>
{props.cat} says, "Meow"
</div>
)
}
class Meow extends Component {
constructor(props){
super(props)
}
render() {
return (
<div>
{props.cat} says, "Meow"
</div>
)
}
}

Why Should You Use a Functional Component?

They’re Easy to Understand

They Can/Will Have Better Performance

They’re Easy to Debug

They’re Easier to Reuse

When You Shouldn’t Use a Functional Component

Full-Stack Engineer, UX/UI Aficionado, and lover of coffee.