Is React still a library?

Hi Guys, I’ve been working with React for almost 3 years and I’ve seen how this library has become one of the most popular tools used in the web (you can use it even for mobile applications: react-native). I’ve seen how projects well written in AngularJS were migrated to React because It has the famous virtual DOM. I’ve seen how the Angular team “failed” in their first attempt to migrate AngularJS and how the developers changed to React for the lack of support of Angular 2 (Of course Angular 5 is pretty stable now, but there was a time where each new version had breaking changes).

React at the beginning was a UI Library, even some devs called it the jQuery of nowadays, but is that still true?

Short answer: Yes!, React by itself is just a UI library, but let’s take a look to the tools that Facebook provides, let’s call it the React Stack:

  • create-react-app: React CLI used to speed up React development
  • jest: Test library that can be used with any other JS library, but it was developed to easily work with React
  • test-utils: Similar to enzyme, it’s a library to shallow render components
  • prop-types: Library used for type-checking

The react stack is pretty complete, but some of the new features were introduced less than a year ago, so they’re new. But we still need help from the community, let’s enumarate the most commonly used modules/packages made by the community:

  • react-router: Library used to handle the app routing in web and mobile
  • redux: State manager tool, inspired in the FLUX architecture
  • mobx: Similar to redux, it’s an state manager
  • enzyme: Library to shallow render components
  • fetch: fetch is not a library made by the community, it’s a native object used for async requests, but it’s not supported in all the browsers, this is why you might need a polyfill

Pretty awesome, isn’t it? but let’s go beyond, we can replace mobx and redux using the new Context API and we can replace enzyme for the react-test-utils, so the React stack would be like:

  • React: UI Library and State manager
  • create-react-app: CLI
  • jest: Test runner
  • test-utils: test utils
  • prop-types: Type checking
  • react-router: App router

React provides almost everything you need but the router, it gives you the UI Library, state manager, CLI, test utils and type checking. For the missing parts, like async requests you can use the new object introduced: fetch, of course it’s not supported for all the browsers, but you can use polyfills (polyfills is not a react thing, they’re used to support pretty much IE and safari; Mozilla and Chrome supports pretty much all the new features)


“tilt photography brown and gray hammer on white surface” by Ash Edmonds on Unsplash

Summary

ReactJS is still a library, but the Facebook team has worked a lot in order to introduce features that help us as react developers, so we could say that Facebook provides us a new stack: The React Stack, a set of tools that can work together or alone, so you’re free to use them with React or keep using the tools made by the community. You can use them with another libraries like Angular if you want, this is what I really like about this stack, some of the tools are pretty focused on React, but some others were meant to work with React and all the JS World.

    Jose Carlos Ixcoatl

    Written by

    Passionate Javascript developer@Intersog previously @unosquare @Accenture @USTGlobal

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade