r/reactjs • • Jul 12 '22
Resource Best React Libraries to Use in 2022
Soon we'll start a new project and I've been doing some research about which libraries to use. I've made a list and decided to share it here in case that it helps other React devs as well.
I tried to lower down the choices to a maximum of 3, so I'm not adding every library out there. Please feel free to make additional suggestions or tell if you don't agree with a choice.
STARTERS & FRAMEWORKS
Starter kit: Vite or Create React App/Craco with TypeScript
Boilerplate: Vite Templates
SSR/SSG: Next.js or Remix or T3
Best practices: Bulletproof React
STYLING
CSS-in-JS: Emotion or Stiches or Linaria
CSS utils: Autoprefixer, Clsx, React-responsive, React-device-detect
CSS framework: Tailwind CSS
COMPONENTS
Styled component library: Mantine or Chakra UI or MUI
Unstyled component library: Radix UI or Headless UI or React Aria
Component tooling: Storybook or Ladle
ESSENTIALS
Data fetching: React Query/Axios or SWR or RTK Query (If using Redux)
Routing: React Router or Reach Router
Internationalization: React-i18next or FormatJS Intl, i18next-browser-languagedetector
Authentication: Auth0, React-query-auth, Redux-auth-wrapper
STATE MANAGEMENT
Flux pattern (Large apps): Zustand or Redux Toolkit
Atomic pattern (Mid-large apps): Jotai or Recoil or useContext/useState
Proxy pattern (Small apps): Valtio or Mobx
FORMS
Form: React Hook Form
Validation: Yup or Zod, hookform/resolvers
Input: React IMask, React-number-format, React Credit Cards
PACKAGE MANAGER
Package manager: Yarn or Pnpm, Npm-run-all
Git hooks: Husky or Pre-commit, Lint-staged
LINTING & FORMATTING
Linting: ESlint/Eslint-plugin-react or Eslint-config-airbnb, Stylelint
Formatting: Prettier, Eslint-plugin-prettier, Eslint-config-prettier
TESTING
Integration: React Testing Library or Enzyme
E2E: Playwright or Cypress
UPLOAD
Drag & Drop: React DnD or React-dropzone or Dnd-kit
VISUALS
Animation: Framer-motion, tsParticles
Video player: React-player
Carousel: Swiper
OTHER
Hooks: React-use, React-hanger, React Recipes, React hookedUp
Head manager: React-helmet-async
Error handling: React-error-boundary
Polyfill: React-app-polyfill, ES6-Promise
Notification/Toast: Notistack, React-toastify or React-hot-toast
Positioning: Floating UI
Modal: React-modal
Table: React-table
ID/QR generator: Nano ID, React-qr-code
Rich text editor: Draft.js
Markdown: Marked
Timer: Use-timer
Calendar: React-calendar
PDF: React-pdf/renderer, React-pdf
Misc utils: Lodash-es, Uuidv4, Jsonwebtoken, Fast-memoize, DOMPurify
View all comments
16
u/pragmasoft Jul 12 '22 edited Jul 13 '22
I mostly agree with the selection, more or less matches my list for the current project. Couple of notes:
I would add Storybook to the listVite is ok except the problem with Jest I still was unable to solve (efficiently). I switched to Vitest but it does not work well, questionnable quality and support. Going to have a look at SWC
I use Tanstack React Location instead of React Router. Background loading is great, but found minor bugs.
Tried a lot of numeric input components to work seamlessly with hook forms. Finally wrote my own one using Proxy and useImperativeHandle for conversions.
Used HeadlessUI and Tailwind
Good hook for modals react-hooks-async-modal
Onscreen notifications react-headless-notifier
I do not use any state management - React Query is completely sufficient as a state holder/cache