Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
turnerhayes opened this issue Nov 6, 2018 · 3 comments
Labels
discussion needed infrastructure tech-debt Used for issues that typically don't directly affect what the end user sees, such as coding styles

Comments

@turnerhayes
Copy link
Collaborator

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 turnerhayes added discussion needed infrastructure tech-debt Used for issues that typically don't directly affect what the end user sees, such as coding styles labels Nov 6, 2018
@turnerhayes
Copy link
Collaborator Author

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

@knod
Copy link
Collaborator

knod commented Nov 7, 2018

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
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion needed infrastructure tech-debt Used for issues that typically don't directly affect what the end user sees, such as coding styles
Projects
None yet
Development

No branches or pull requests

3 participants