Why I was feeling React is crazy
After working with Ember, Angular, I thought it’s time to invest time to another great framework (yeah, I used to think it’s also a framework) React.js and started accordingly. But while working I found it so different and may be a little crazy. Below are the probable reasons why my mind was reacting like that at that point of time.
Inversion of control
While working in other frameworks like Ember Angular, my mind probably started searching for a framework in react, which it was not. (You can check my framework vs library article if you are not sure about the differences.) I was missing predefined practices and a place where things can be done in one way only. But react was full of diversity. You need to build a project from the scratch and you will probably use react just for rendering. You have your own rights to choose a routing library, model handlers whether to go with flux way or mvc or use a redux kind of thing. If you are not an opinionated person and there is a wide range of options in-front of you; you will become confused about the best selections until and unless you go through all of them; which is a huge time investment.
.innerHTML, which none of us prefer using frequently in application development.
I found majority of the tutorials out there in the internet talks about using webpack for scaffolding your first react application. But I think it confuses people. People should first know basic react. Without webpack or ever without flux redux. Knowing react just as a rendering library is more important than how to scaffold a project.
Data flow in a single direction
Ember, Angular uses two way data binding, while react make the data flow in a single direction only. So trying to learn react after those two frameworks gave me a feeling that I need to handle data change manually. Today the scenario is a little different; Angular 2 is following similar approach and in Ember also people are following this approach rather than using direct two way data binding.
.jsx instead of
.js? First of all it given me a non native feeling and the HTMListic syntaxes also drove me crazy. The same reason why I’m not liking Angular 2 much these days.
But I still love React
Yeah, I’m not a hater. I’m developing the front-end of my product Programming City using react. I never say a certain thing is good or bad; cause it’s always the situation who plays the key role to make the decision. Well, below are the points I would like to mention in favor of React.js.
- The difficulties I mentioned in just a state of mind. They couldn’t last long.
- Webpack is really helpful and you will fall in love with it once you read about it properly.
- If someone is more into frameworks then libraries; there are starter kits available for them to code in react easily.
- React is fast. Really fast initial rendering.