Hello developers!! While developing apps in React, I'm sure you have come across different use cases which cannot be easy to solve using the same o...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
Why are you making so much use of Class components?
I believe they're seen as bad practice, no?
Not really bad practice per say. Just that their use are discouraged and instead functional components should be used.
Deprecated as per React 18 and the new React docs.
I don't believe that class components deserve the bad rep.
I'm a big fan of classes and object oriented programming but I don't think classes are a good use case for react components.
Dan Abramov explains here how class components can lead to bugs which are avoided with functional components.
overreacted.io/how-are-function-co...
Furthermore, you can't use hooks in class components so you are limited to what libraries and other parts of your code base you can use if you mix and match between classes and functional components
From react components docs: "Class components are still supported by React, but we don’t recommend using them in new code."
Lol I use all of them but never heard that they are called this way.
Everyone uses all of these just they don't know
There's a difference between using a library that happens to still use class components and writing class components yourself though...
Few things to take into account:
const { Provider } = ListContext;
on every render, just move to outside of the component.@erickjth Thank you for your suggestions. I'll surely update the examples.
Thanks for article ,👏👏😃
THANKS A LOT!
Amazing!
Great Design Patterns. I like them.
@just-another-girl-w3 I'm glad you find it useful!!😃
Class components... MY EYES 🤮
Am I the only one that thinks that Presentational/Container pattern does the opposite of helping?
Great article , please checkout this website refactoring.guru/design-patterns and tell me what’s the difference between patterns with those that you mentioned
withLogging or withLogger ? I think you have a typo there.