DEV Community

Cover image for Class Components vs. Stateless Functional Components

Class Components vs. Stateless Functional Components

Tim Smith on August 31, 2018

When I first began to learn React, I didn't even realize there was a difference between class components and stateless functional components. I tho...
Collapse
 
mahlongumbs profile image
Mahlon Gumbs • Edited

In the context of React “Stateless Functional Component (SFC)” is actually the correct term. There is a documented difference between properties and state. While all components in React may take input, that input is always referred to as properties. State is specifically data that a component manages internally. SFCs are thus named due to their inability to possess/manage state.

Technically, one could return a closure and manage state in a SFC, but that would be unusual.

Collapse
 
iam_timsmith profile image
Tim Smith • Edited

Touché. Typically, the nomenclature I see around this is “stateless functional components” so I figured i’d stick with it.

 
ancientswordrage profile image
AncientSwordRage

Isomorphic just means 'same shape's so it should be the same shape code on both server and client.

 
ancientswordrage profile image
AncientSwordRage

Hey, that's great — not doubting you. Portable tends to be used for software that doesn't need to be recompiled for different machines.

No words going to be perfect though.

Collapse
 
kennedybaird profile image
Kennedy Baird

What do you mean by side effect free?