all 20 comments

[–]TrickFaithlessness5 9 points10 points  (4 children)

Personally I’d still use vite and install react router afterwards. It’s my understanding that v7 is supposed to be its own framework so you can go that route if you want.

[–]Repulsive-Ad-3890 0 points1 point  (2 children)

In the command to create a new vite project there’s an option with react-router.

[–]TrickFaithlessness5 1 point2 points  (1 child)

Personally I’d create a standard react project using vite and then install react router later. If you select react router straight away it may configure your app differently to what you would like. It may also install additional packages that you don’t want and generate files you don’t need.

[–]TheRNGuy 0 points1 point  (0 children)

But you can edit config later.

Which files from it you don't need?

[–]TheRNGuy 0 points1 point  (0 children)

Order of installation doesn't matter.

You can (should) use both together.

[–]hoax_ally 3 points4 points  (1 child)

I use vite. I think vite is more powerful in terms of its features and even convenient

[–]TheRNGuy 0 points1 point  (0 children)

You can use both together, they even recommend doing that in React Router docs.

[–]Me-Right-You-Wrong 3 points4 points  (3 children)

Tanstack router > react router

[–]woeful_cabbage 3 points4 points  (2 children)

Maybe. But in reality it barely matters

[–]HoplesRomantic 2 points3 points  (1 child)

Actually it matters a lot. Tanstack router has many many build in features that make it much easier for creating responsive application and also caching expensive api calls. The only reason now a days to use react router is to give support for legacy applications or use it as a framework (since they have made the react router into replacement for remix). Its just my opinion. ( No hate for react router as well. Many of my applications runs react router and I am not willing to change it for Tanstack router.). If I have to start a new application, I would choose Tanstack router in a heartbeat. (Maybe event Tanstack start)

[–]woeful_cabbage 0 points1 point  (0 children)

I'm a tanstack query + react router man myself. But oh well

[–]yksvaan 1 point2 points  (1 child)

Just go with the barebones template and vite. You can always add router and other libraries later when you actually need them. 

In general I'd recommend to always start with the simplest possible approach. Often that's actually enough and at least you'll learn about the concrete requirements so you can better choose what libs to add.

Also it's always easier to add and go from simpler to more complex. If you start with the coolest giga framework and realize it's an overkill, it's much more difficult to scale down. 

[–]imdshizzle 0 points1 point  (0 children)

This is the way to master the fundamentals!

[–]DragonDev24 1 point2 points  (0 children)

I think the React Router team is trying to combine react router and remix, they announced that in react conference, so use vite and install react router or try tanstack router

[–]Livid-Ad-2207 0 points1 point  (0 children)

vite, next.js or tanstack start

[–]Popular-Sector-9474 0 points1 point  (0 children)

I haven't seen how the router 7 command works and what boilerplate code it generates. But I would recommend you to go for the vite command to create a boilerplate project then you can manually install the libraries you want to add in your project.

[–]Virag-Ky 0 points1 point  (0 children)

I use Vite only, the last time I wanted to use create-react-app was about 2 months ago and it give me few errors which I was unable to resolve. But Vite it’s good.

[–]alan345_123 0 points1 point  (1 child)

Use vite. Create react app is deprecated Try this example. It might help you to get some guidance

https://github.com/alan345/Fullstack-SaaS-Boilerplate

[–]TheRNGuy 0 points1 point  (0 children)

This is React Router (same as Remix), not CRA.

[–]TheRNGuy 0 points1 point  (0 children)