Owen Abbott
1 min readJan 17, 2021

--

Why use a functional component instead of a class component in react.

The reason I don’t know the answer to this, dear reader, is because I am completely and totally self taught. The instructors at Flatiron never addressed it in their lectures, and honestly didn’t teach me anything, and the technical coaches were mostly students who only had experience in Flatiron so they certainly didn’t know.

Maybe it’s a mystery to everyone. Lets find out!

After about five minutes of google searching, I found several medium blogs presumably written by other flatiron alumni, of which I could only see the first few sentences, and a stack overflow post. The consensus seems to be that functional components are better to use if your component doesn’t have state.

But why!

I don’t know.

Optimization, I suppose.

So I guess that’s my blog for today. Use functional components if your component doesn’t have state.

What a useful tip for the aspiring front end developer.

--

--