codeforboston / cliff-effects

Cliff effects guidance prototype (archived)
https://codeforboston.github.io/cliff-effects/#/
MIT License
30 stars 64 forks source link

Switch to component classes instead of stateless functional components? #975

Open turnerhayes opened 5 years ago

turnerhayes commented 5 years ago

Wanted to bring this up for discussion; it appears that Stateless Functional components (i.e. components declared as simple functions, not classes) are not (easily) selectable in React Devtools (intentionally). The $r shortcut is really useful for inspecting state and props. Should we convert our components to class components?

turnerhayes commented 5 years ago

I believe Hot Module Reloading is also not available with SFCs (although not 100% on that).

knod commented 5 years ago

Hot reloading is fun, it's true. Can you link to an article or two on the advantages of stateless functional components so we can weigh pros and cons?

dylanesque commented 5 years ago

I'm a little skeptical, this seems like a lot of refactoring for what strikes me as a minor convenience for developers. IIRC, quite a few of the components in the app are SFCs already.