About Me: I've been a professional web developer for just over 10 years now. I'm currently the lead web development instructor at Better Coding Academy, and as part of what I do, I post videos on our YouTube channel at https://www.youtube.com/c/BetterCodingAcademy.
(Subscribe for awesome web development content!)
Having been a React developer for over 5 years now, I've written a lot of React code, and installed a lot of npm packages.
However, after looking through all the code I've written in all this time, there are a few npm packages that clearly stand out to me from the others. Here is a list of the ones I've found myself coming back to, time and time again.
react-dom- as a React developer, these are pretty standard - part and parcel of the React ecosystem, of course. https://reactjs.org
parcel- speaking of Parcel :) - Parcel is a "zero-configuration web application bundler". I love Parcel because of how easy it is to get set up on a small to medium-size project. For larger projects I prefer Webpack, but I love Parcel simply for its ease of use. https://parceljs.org/
webpack-dev-server- Webpack is THE most powerful web application bundler, and I find myself coming back to it for every single professional-scale project I work on. Its configurability is second-to-none and that's why I love using it. Main downside is that there definitely is a fair bit of head-scratching to get you on the right track, but it's a worthwhile investment for sure. https://webpack.js.org
axios- Axios is a REST client for both the browser and Node.js. This one is one of my absolute favourites. I love how intuitive Axios is, and I love how easy it is to set up and get working. https://github.com/axios/axios
final-form- my personal form manager of choice, I use
react-final-formfor all form-related stuff in my React projects. It's incredibly powerful out-of-the-box, yet can also be easily customised and extended too. http://github.com/final-form/react-final-form
react-router-dom- the go-to router for React on the web, I absolutely love it. It's ubiquitous, powerful, and super-customisable as well. A must-know. https://reacttraining.com/react-router/
polished- in spite of some critical design flaws, I still like using Styled Components. I particularly like its support for React Native - makes styling so much easier. http://styled-components.com
date-fns- I find
date-fnsto be a better alternative to Moment.js. I used to use Moment.js quite a lot, but I just find
date-fnsdoes the trick with a smaller footprint and more functional syntax. Not a big fan of Moment.js mutations. https://date-fns.org/
And here are some honourable mentions:
@apollo/clientand related packages - I do a lot of work with GraphQL, and my go-to client library is Apollo. It's been working really well for me, and I especially love the new hooks API. Support for Vue and Angular amongst other platforms is also a huge plus. https://www.apollographql.com/docs/react/
redux- although I'm not the hugest fan of Redux I still find myself using it in pretty much every project I build. However, it's worth noting that my use of Redux is kept extremely minimal - I usually have hardly anything other than session management, even in extremely complex React applications. There is a time and a place for everything, and I think that that applies to Redux especially. https://redux.js.org/
immutable- this library has been surprisingly useful. Although the docs are difficult to understand and the library has a huge footprint, I do find myself using it far more often than I would like to admit, and I do think that its power level justifies its use case in some niche scenarios. Worth knowing about though, in any case. https://immutable-js.github.io/immutable-js/
react-select- beautifully built and very customisable, but difficult-to-understand docs and longwinded configuration options keep it out of the top list. I still love using it though. https://react-select.com/
What are your favourite npm packages?