I've just started my journey with React and I'm feeling a bit overwhelmed by all the different methods available for handling routing. I know that there are various options that suit different needs, but it's tricky to keep up with what's current and what's outdated. I'm looking to pinpoint the best practices for routing in React so I can focus my learning on the right tools. If anyone has links to good articles or resources that cover this topic thoroughly, I would really appreciate it!
5 Answers
I'm in a similar boat! I decided to go with the latest React Router since I'm not looking to dive into Next.js yet. It seems straightforward for now.
I've been using React Router for a while, and it's been great for my projects. It's been around for almost a decade, so it's pretty stable. If you're looking for basic client-side routing, React Router, combined with something like React Query, works really well for caching.
I'm looking into it as well! Seems to be a popular choice.
From my experience working with different routing libraries like Next.js, Remix, and Astro, each has its quirks. If you're just starting, I found Wouter to be the most lightweight and user-friendly for a client-side React project today.
It really depends on your preference! I usually lean towards typed routers—makes things clearer and helps catch mistakes early on.
Astro might be worth checking out too. It's pretty intuitive with its page-based routing. Just keep in mind, you may need to work with TypeScript at some point.
Yeah, React Router has served me well too. I think it's a solid choice for most cases.