At Customerly, we know that choosing the right React libraries can be time-consuming. That’s why we want to help you by sharing our thoughts on the best ones we use for our products.
We want to help you save time by sharing our discoveries on the best React libraries we used to create our most advanced React-based web app.
TypeScript is the base if you want to keep your JS code clean. You should start using React with TypeScript because it removes a lot of errors while you write the code and makes the code clearer to the other React developers.
We think it’s a must-have for your applications. You can’t start a production environment application on React without using TypeScript.
If you are searching for a tool to build your React project, Vite is the right choice.
You maybe know Create React App, which was the first tool created by Facebook Open Source about 7 years ago.
Today you should prefer Vite over Create React App for different reasons:
In Customerly, we still have Create React App, but we plan to switch to Vite early. You should too.
The best React framework you can currently find on the open-source scene is NextJS.
It adds many features to React, like creating custom APIs, default components for SEO, server-side rendering, static site generation, and a hybrid of the last two features, which is called Incremental Static Generation.
If you are creating a landing page, a blog, or an application that has to be perfect on the SEO side, you should go for NextJS. We used it in Customerly to create our customers’ help centers with tens of thousands of articles updated in real-time.
React Router is one of the most important libraries because it’s the main library that handles routing in your web application.
It’s an open-source library created by Remix, it’s downloaded about 10 million times per week, and it’s been downloaded about 1 billion times. It’s the most used one between React libraries.
This library enables client-side routing, meaning the browser doesn’t need to reload HTML and CSS to go to another page. Still, the application can immediately render a new page without navigating like a normal website.
If you want to uncover the best techniques for leveraging this library to its fullest potential, follow the Master React Libraries video course.
If you want to create from scratch reusable UI components, you should choose Styled Components.
Styled Components is a library that simplifies the job of creating UI components. Many popular companies use it for user interfaces, like Revolut, Airbnb, Google, RedBull, CoinBase, GitHub, Spotify, etc.
React components created with Styled Components can be fully customizable because it’s simply based on CSS but with some JS superpowers.
Through this library, you can customize primitive UI components to use them in your application to create a perfect user interface. We’ve chosen it to create every React project we have in Customerly. So we didn’t use any React component library.
When starting a React project, you may notice that there are various React UI libraries like React Bootstrap, Material UI, Chakra UI, Semantic UI React, Ant Design, BluePrint UI, Theme UI, and much more. Although these pre-built React components may seem like a time-efficient solution, we found that creating custom UI components tailored to our needs was more beneficial.
If you’re looking to create a seamless user experience, delegating the creation of your UI to an agency can help you design the perfect components for your app. After investing the initial time into creating unique components, the rest was smooth sailing. Using React component libraries becomes unnecessary.
When it comes to your project, creating a UI that perfectly aligns with your brand’s vision is important. Using a React UI component library for PoCs or smaller projects may be suitable, but building every custom React component is essential for software like yours. Doing so ensures your UI is unique and tailored to your specific needs.
Another interesting library you should use is TanStack Query. It does a lot of things, like:
You can create everything with React hooks, which are simple and fast.
It’s easy to implement and doesn’t require you to write so much boilerplate code, so we used it in our web application with Axios as a request client.
You can discover how to use TanStack Query at its fullest potential by following this video course: Master React Libraries.
You maybe have some conventions in your company, and maybe someone is not respecting them, writing code with an inconsistent style. Prettier solves this problem by removing all original styling and ensuring that all outputted code conforms to a consistent style.
It’s easy to set up, and all the IDEs support it. With this, you can forget to add semicolons, put a full stop after some characters, respect the conventions you have, etc.
This library does all these things alone, on file saving. You can add it to automatic code reviews in CI, like DangerJS. We use it for all our front-end projects in Customerly and also for non-React projects.
State management libraries are a super debated topic among React developers because it’s part of the core components of React apps and obviously can make your React applications and components faster or slower.
There are different state management React libraries, but the most used one is Redux. The Redux’s biggest problem is the boilerplate code.
Besides that, the learning curve is quite steep, and if you don’t need middleware or complex logic in React, you should go for Recoil because it’s easier to use and faster.
Maximize the potential of Recoil by taking the Master React Libraries video course.
These functions help you when you are modifying big objects and you need to modify nested children. It’s hard to explain, but you should need it in 90% of cases.
These functions were already present in older versions of React, they have been removed, but there’s a drop-in open-source replacement you can find on GitHub and NPM, which is immutability-helper.
Other React libraries do similar things, like Immer and Immutable.JS, but they don’t use native JS operations like immutability-helper, so they are much slower.
One of the best libraries for web applications you should use is i18next. You can guess from the name which is a library for internationalization.
You should go for i18next for various reasons:
In Customerly, we use it in every React project. The benefits it brings are a no-brainer pro for your React applications.
Our advice is to follow the correct conventions while creating translations.
Unleash the full power of this library by watching the Master React Libraries video course.
Another important library you should look at is TanStack Table. This library simplifies table design system building with hooks and components. It’s one of the best React libraries for tables.
It’s fully customizable with your style and has many features like sorting (and multi-sorting), filtering, virtualization with TanStack Virtual, and much more.
You should absolutely use it for your React projects where you have tables with complex logic. It’s also compatible with infinite queries.
Let’s pass to the WYSIWYG text editors. The first one you should check is Quill.
It’s one of the most used ones. LinkedIn, Slack, AirTable, and many other companies use it.
If you are searching for a good uncontrolled text editor for React with many features for real-time chats or similar projects, this should be your choice. We use it for conversation inboxes in Customerly.
Another WYSIWYG text editor you should check out is TipTap. It’s a headless editor framework based on ProseMirror.
Substack, Ahrefs, Storyblok, Gitlab, and many others use this editor.
If you are searching for a controlled text editor with many extensions to create article editors or similar components, you should go for it. We use it for the help center article editor in Customerly.
Let’s assume you are creating a React application with flows to manage some logic. You should manually create all the components and logic. Using the Canvas functions is obviously a big pain.
React Flow has been created because it’s easy to implement and use, but it’s also customizable with your UI.
Important companies like LinkedIn, Stripe, Typeform, OneSignal, and others use it.
You should absolutely go for it. We use it in Customerly to let users build their custom Workflows.
While talking about TanStack Query, you maybe read about TanStack Virtual, which is perfect for virtualizing tables created with TanStack Query.
But if you want to virtualize some other components, you should go for React Virtuoso, which is the perfect replacement for older React Window and React Virtualized.
React Virtuoso is simple to set up and lets you virtualize your lists and other components in an “automatic” way, maintaining high performance.
In Customerly, we use it everywhere but tables, as you’ve seen before.
As the image above shows, Luxon is the Moment.js killer for various reasons. It’s been created by the same team. It’s a JS library, so not only for React.
If you are asking why, these are the main reasons:
You shouldn’t need more information to go for it simply. We use it in Customerly for all dates and times formatting.
React controlled inputs are good, but you maybe need uncontrolled forms for better performance or validation. React uncontrolled forms are not easy to manage in React; you have to create a lot of boilerplate code.
These problems have been solved by React Hook Form, which is a library that provides a hook to manage our uncontrolled forms.
It’s super light, super fast, and without useless boilerplate code. If you are creating a lot of forms, this is the solution. We use it in Customerly for almost every form we have in React.
Leaflet is the leading open-source JavaScript library for interactive maps. React Leaflet is simply a wrapper which gives us high-quality react components for showing maps.
It’s the perfect library if you are searching for some React component libraries which provide maps. It’s also customizable with different map styles.
You should absolutely go for it. We also use it in Customerly for our map components.
Fuse.js is a powerful, lightweight fuzzy-search library with zero dependencies. It’s perfect if you have to do client searches on big objects or arrays.
Let me explain if you don’t know what fuzzy searching is. Generally speaking, fuzzy searching is the technique of finding strings that are approximately equal to a given pattern (rather than exactly).
So, for example, if you are searching for the word “customerly” and you write “csutomelry” it finds it.
It’s fantastic for users because they don’t have to pay much attention while searching for things. We use it for almost every search input in Customerly.
Socket.IO is a library that enables bidirectional, low-latency, and event-based communications between a client and a server.
If you are creating a real-time chat application or something similar, this is the best library to manage sockets.
It is built on the WebSocket protocol and provides additional guarantees like a fallback to HTTP long-polling or automatic reconnection.
It’s simple to use, and without boilerplate code, we use it in Customerly mainly for real-time messaging and other logic. Mainly to not over-stress our backend.
Obviously, the React Live Chat Customerly library can’t be missed from this list.
To easily implement Customerly in your projects, we created this library, which has a lot of functions you previously used on Javascript.
The library is based on Typescript, and its size is only some KBs. If you use Customerly for your business, you should use this library for your React projects.
Choosing the right library for your project is important for your future application’s success. So, now, you may ask yourself the best way to choose React libraries for your applications.
We use different criteria. Let’s see them:
This is how we do in Customerly and what you should do for your projects, not only for React but for all of them.
As you saw before, if you want to master 4 of React libraries you’ve seen in this article, you can watch the Master React Libraries course.
In the course, you can see how to master those libraries, and you can also see how we used them in the Customerly codebase in the production environment.
You now know all the most important open-source libraries of the React scene. We can expect more libraries and gems to emerge as we move forward. Still, for now, this list provides an excellent starting point for developing innovative applications in the world of React.
This blog post was originally published at: Source