DEV Community

Discussion on: About React code structure

Collapse
 
elanandkumar profile image
Anand Kumar

It all depends on the component.

  1. Use class if you need to use component lifecycle methods.
  2. Other two are functional component with a bit different code style.
Collapse
 
gundogduyakici profile image
Gündoğdu Yakıcı • Edited

Mmm.. I'm understand.. whichever is easier and convenient then choose one