Salam and Hello!
Before I make any statement here, React IS one of the way to web development. Of course, with all the supports garnered from the community, React is a to-go framework for modern web app. Well, I already 2 years with React, so of course my opinion might be bias, even a bit.
So, back to our topic. Is using React the best way to web development?
Then, comes the existence of NodeJS, to support these frameworks outside browser's V8 engine, so that the codes can be run without any problem. Then comes the other issue such as optimization, performance, Lighthouse benchmarks and others.
There are a lot of things to consider when starting a framework, right? Well, let's go for more details in React.
As stated, there are 3 niche that they offered along with the framework.
Declarative: Declarative views make your code more predictable and easier to debug.
Component-Based: Build encapsulated components that manage their own state, then compose them to make complex UIs.
Learn Once, Write Anywhere: We don’t make assumptions about the rest of your technology stack, so you can develop new features in React without rewriting existing code.
Let me try to put it in a simple way. You can create your own component, split the code for each component, declare the component by giving it a proper name, and the pattern can be used anywhere, without having to repeat yourself.
React is using virtual DOM (Document Object Model) manipulation, means that the event changes happened behind the scene, and the page will be ready, even before you realise it! Compare to traditional approach, you need to target specific DOM Object, and trigger the change yourself. If you didn't know how to modify it, it might trigger performance issue.
className instead of
htmlFor instead of
To handle event changes, React is using state and props, which allows React to monitor the changes and prepare for DOM manipulation. State is what defines changes inside components, and props is what component uses to communicate with other components. With this in mind, React is more suitable for compositioning rather than inheritance.
React can be done using 2 patterns. One, is class components, and other is functional components. There is no wrong way in managing your components, though most, including myself feels that using OOP (Object-Oriented Programming) pattern by using class components is actually anti-pattern, as I said before that it is more compositioning than inheritance. But, you do you, and of course it depends on use case.
There are still a lot of thing about React, but I think these are some main takeaway when people decide to use React.
When using a tool, we should always see how it benefit us, and how can it be to our disadvantage.
The fact that it uses JSX, some of beginners find it difficult to follow. The difference in syntax makes it hard to switch knowledge between standard HTML and JSX pattern. However, I fairly believe this factor is not bothering that much.
State and props concept. This is one of the factor that makes learning React hard to grasp. Personally, during my first 3 months of using React, I am still confused with these concept that I am not familiar. But maybe, I will explain these concept in my next article? 🤔
There's another debate whether React, or even any other JS frameworks is needed in web development, since it depends on the requirement. There are a lot of web page, that only serve to display a single, scrollable page, without any routes whatsoever. So, the conservatives believe that you didn't even need to use React, just to build that web. Let's call them "The Amish of Web"!
Some even consider the learning curve of React, so instead of going for React, they want to learn Vue instead (no hate though, I am currently using Vue for my current project!), since Vue is more beginner-friendly, and closely related to standard HTML pattern, and using Handlebar-like to handle data.
Okay. Put all the pros and cons aside for a while, and ask yourself this question first.
"Are you just starting to learn frontend development?"
"Do you want to learn, for your own objective, such as changing career?"
"Do you want to be up and running after learning these knowledges?"
As long as there is "learning", there is never a wrong way of picking up what you want to learn. Of course, there are other consideration such as marketability, urgency and others, but I will again say, there is never a wrong way to be someone you want.
For me, gatekeeping is actually a bad thing to do, especially the senior in industry. We need to realise that we are, indeed a beginner once, asking the same thing to ourselves, of what we want to be in future. We were once stupid, and will always be. There are no limitation of what you want to learn.
However! However! Of course, you need to know how to "learn". Stop thinking too much, scrolling the forums to see what is the best way, and read all these OG's debate on what is "their best way". Take whatever constructive, and keep those in mind, walk away, and keep proceed to learn, so that in future, when you have the expertise, you know what you will do to tackle those issues. Learning is a never-ending process, a lifetime opportunity that is given to us, picking up whatever interests and benefits us.
But of course, no Angular! 😈 Hahahahahahaha just kidding!
Remember Atif, no gatekeeping! Let other people learn what they want. Give them guide whenever they need. Yes Atif, be compassionate!
To you, peace be upon ya!