Single Responsibility Principle (SRP)
A component should have only one reason to change, meaning it should have only one job.
...
For further actions, you may consider blocking this person and/or reporting abuse
As someone who came from a SOLID background (PHP) and started functional programming using React this article did an awesome job without trying to shoehorn JavaScript classes into React's functional style.
Love the examples of do vs don't. They were easy to follow, simple, and made sense. Good job
Hi Kearney, thanks so much for your kind words! Iβm really glad to hear that the examples were clear and helpful for you. If there's any other topic you'd like to see covered in this style, let me know!
Looking at this principles, I can boldly say that I have learnt the conventional ways of writing codes from Open University of Helsinki. Although, I never knew they had names but we were taught all these.
Thanks for this piece of information π
Thatβs fantastic, Monsur! It's great to hear about your experiences with the Open University of Helsinki.
Pretty nice article! ππ I created one regarding unit test and the component used as example was created using both SRP and OCP principles. I even said that in my article too.
Unit Testing: A Hands-On Guide with Real Examples - React + Vitest (p.1)
Amazing stuff!
Thank you very much. This help me so much!
You're welcome.
sensational
hehe
I really loved your article, I myself like the idea of applying SOLID in ReactJS and I have an article about it, congratulations on the great initiative and sharing of knowledge <3
Thank you so much for your kind words and for sharing your enthusiasm for applying SOLID principles in ReactJS.
Good explanation and example code.
Thank you!
I'm glad you found the information helpful!
Great examples
Thank you, Otavio! I put a lot of thought into those examples, so Iβm really glad they resonated with you.
nice read
Thanks Visakh!
Awesome article
Thanks, Jitendra.
It's very helpful. Thanksππ»
You're welcome! Iβm so glad you found the article helpful.
Amazing post!!
Thanks, Anderson! I appreciate your feedback.
that is awesome!
thank you!!
In ISP, the Text Component should extend let's say the H1 tag; ie. ComponentWithoutProps<'h1'>.
This will not force you to use unnecessary properties and it also follows the rule of OCP.
Hi Arian, that's an interesting take on ISP! Extending the H1 tag like that can indeed simplify component interfaces. Thanks for sharing this tip!
Simple explanation and very powerful !!
Thank you, Deepak! I'm glad you found the explanation simple yet impactful. It's always great to hear that the content is hitting the right notes.
nice
thanks
Not even a casual mention of Uncle Bob Martin. Shameful.
Hi Joshua, you make a fair point. Uncle Bob Martin's work has been foundational in the software development world. Thanks for your feedback! :')