Why Your Library Sucks: React

Denny Headrick
3 min readSep 3, 2017

--

Hey there. I want to congratulate you on all of the success of your library. You currently have more than 74,000 GitHub stars. You’ve made it. You have 27,882 Redditors subscribed to your sub. That’s 7,000 more than Angular’s! You have won the social media aspect of getting your name out there (surprise!).

Interestingly enough, you achieved only a score of 1,455 on Libscore which pales in comparison to Angular’s 12,084 or jQuery’s monolithic 692,981. What’s that? Libscore’s not accurate? I don’t care if it’s accurate or not.

Really, I don’t care if Libscore is accurate.

The worst issue is your library has a license that is just bleeping weird. What is the point of being different if your license has no bite to it? Furthermore, why refuse moving to MIT or something else that the community can really understand your intent?

Everybody else said, “hey lets go ahead and put a little script into our HTML.” You said, “let’s put our markup into the JavaScript without the quotes.” Then comes JSX along with all those glorious ternary operators.

I mentioned to a junior developer that his return function was getting a little unsightly with the lengthy JSX that he’d put in his render function. He told me, “Oh it’s cool. I’ll break it out into several functions that return JSX.

I pushed him into a volcano.

The gods smiled upon us and we had rain.

Oh, you don’t have to use JSX in React? That brings me to my next point. React’s ecosystem features people that point out that you don’t need to use JSX as if there’s a lot of non-JSX React development going on.

React makes web development easier by dividing everything into components.

Let me put my response in a way that you might understand:

[83, 79, 32, 68, 
79, 69, 83, 32,
69, 86, 69, 82,
89, 32, 79, 84,
72, 69, 82, 32,
70, 82, 65, 77,
69, 87, 79, 82,
75, 33]
.map(s=>String.fromCharCode(s)).join('');

So, you can’t scale well. Don’t worry. That happens to a lot of guys. Oh, there’s state management. Oh goody. Do tell. Redux? Time travel? Sounds great. Tell me more…

So, I just throw my state in one place and use reducers to update the state. Got it. What? Replace it? Treat everything as being immutable. So… you’re telling me that Redux which is praised for bringing order to React apps makes me replace entire objects instead of changing their properties? You don’t really think that JavaScript objects are somehow lesser objects after they’ve been touched, do you?

Just like jQuery, your library will die a slow and painful death and be in projects for years to come.

This is the second post of my “Why Your Library Sucks” series. If you’d like to see more, hit applaud. If you have a request, leave a comment.

--

--