A compelling reason not to use ReactJS

At HackReactor, I recently had a conversation about the React framework, which is quickly becoming one of the most talked about frameworks among my peers. However, during my conversation with a recent graduate, I was told a compelling reason not to use React: if you agree to their terms and conditions, roughly speaking, you agree not to sue Facebook or any of its subsidiaries, while being liable to being sued by Facebook, its subsidiaries or corporate affiliates for patent infringement. I will not re-hash the discussion here besides linking to this discussion I found on Y-combinator news.

Quoted from Github, with the notable portion emboldened:

Additional Grant of Patent Rights Version 2
“Software” means the React software distributed by Facebook, Inc.
Facebook, Inc. (“Facebook”) hereby grants to each recipient of the Software (“you”) a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (subject to the termination provision below) license under any Necessary Claims, to make, have made, use, sell, offer to sell, import, and otherwise transfer the Software. For avoidance of doubt, no license is granted under Facebook’s rights in any patent claims that are infringed by (i) modifications to the Software made by you or any third party or (ii) the Software in combination with any software or other technology.
The license granted hereunder will terminate, automatically and without notice, if you (or any of your subsidiaries, corporate affiliates or agents) initiate directly or indirectly, or take a direct financial interest in, any Patent Assertion: (i) against Facebook or any of its subsidiaries or corporate affiliates, (ii) against any party if such Patent Assertion arises in whole or in part from any software, technology, product or service of Facebook or any of its subsidiaries or corporate affiliates, or (iii) against any party relating to the Software. Notwithstanding the foregoing, if Facebook or any of its subsidiaries or corporate affiliates files a lawsuit alleging patent infringement against you in the first instance, and you respond by filing a patent infringement counterclaim in that lawsuit against that party that is unrelated to the Software, the license granted hereunder will not terminate under section (i) of this paragraph due to such counterclaim.
A “Necessary Claim” is a claim of a patent owned by Facebook that is necessarily infringed by the Software standing alone.
A “Patent Assertion” is any lawsuit or other action alleging direct, indirect, or contributory infringement or inducement to infringe any patent, including a cross-claim or counterclaim.

In our conversation, she explained that the startup company she was working for opted not to build on React because one potential exit strategy of theirs was to be bought out, and companies such as Microsoft, Google, or Apple that often buy out other tech startups care about such things because patent lawsuits against other tech rivals such as Facebook are something that they may engage in. If the company they are considering is built on React, and buying them out jeopardizes their ability to sue or puts them at risk of being sued, this is enough to spoil the buy-out exit strategy, especially if the potential buyer determines that refactoring your entire code base to work without React will take too long or cost to much, or would otherwise be too large a risk for them. For this reason alone, they deemed building their technology on React to be a significant business risk, and opted not to use React as the basis of their application’s view layer.

A compelling alternative to React: RiotJS

If you need a React-like view layer, consider using the Riot micro-framework. Its license, the MIT license, does not have the same threatening restrictions, and the small size of the framework and the minimalist approach is quite compelling. Riot also has very few public methods, which makes learning it a smaller undertaking.

The most compelling thing about Riot is the minimalist elegance of their view code. See this comparison of code from React followed by the same functionality implemented by Riot. The design approach advocated by Riot is a lot less complicated. As judged by design value “make it as simple as possible, as complex as it needs to be”, it would seem that Riot’s approach is superior.

The most common objection I hear when I bring up Riot is the perception and fear that everyone is using React, and that the larger community around React and Facebook’s backing are benefits that Riot cannot supply. This argument doesn’t sway me; React’s community may be bigger than Riot’s, but relatively speaking, when comparing frameworks that are this new, this is like comparing the size of two gnats at an air show. The superior technology is the one to get behind, even if it is new and the community is small. A big community and major corporate backing matters more if much technical support is needed to help users cope with the complexity of a framework, and React seems to be complex enough to warrant this, but Riot is so small (6.7 kb minified, vs. 127 kb for minified React) that much of that complexity simply isn’t there.

By the way, Egghead.io has short video lessons on how to use Riot, if you’re looking for instructional material.

Another compelling alternative to React: Vue.JS

Someone pointed out to me that Riot isn’t the only minimalist option, and that Riot allegedly doesn’t actually do conditional rendering; it renders in full and hides one branch. I haven’t worked with both to be able to say for sure, and I don’t know what’s wrong with the approach Riot takes, but check out Vue.JS as well.

Conclusion

The conclusion of this is simple: it is not necessarily a benefit to be building your web app on a technology backed by a major tech corporation such as Facebook; if they have terms and conditions that allow the offensive use of patent lawsuits against you and forbid defensive lawsuits against them, that’s a huge legal risk that is simply not worth it, especially if you want to sell your company to someone other than Facebook as a potential exit strategy.

Like what you read? Give Berkana a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.