Why React
Eugen Kiss
91

While I agree with practically all of the article and think conceptually react is great I strongly disagree with this one

“In other frameworks, a component’s view tree description resides in its own file, separate from the rest of the component. This is separation for the sake of separation, motivated by dubious concerns”

There are very good reasons to separate the view tree description usually written in a DSL (in React’s case JSX) from the code that powers the view. React forces my whole toolchain to support JSX. You want to use TypeScript — sorry you’ll have to wait for TS to introduce support for JSX right there inside their compiler (they already did but there was some period where it was not possible to use TS with React because of the JSX issue). You want to use your favorite HTML editor with all the features you love — sorry you are not allowed to use separate files the JS editor must support JSX.

Forcing the whole toolchain to support a specific DSL is outright bad engineering. They could have easily provided an option to use separate file or at least allowed for the JSX to be contained in a string so my tools of choice were not excluded. In fact Angular 2 did precisely that. It gives you the option to have your template code in a separate file or in a string in the same file and all existing tools work without the need for special support for Angular 2.

I believe that this approach is a sign of poor quality library and while I love the concept of React and think that it is superior to everything else I have seen this issue and some poor naming choices made me choose Angular 2 for my current projects.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.