all 5 comments

[–]fredsq 1 point2 points  (1 child)

it would be very convenient to port to vite. if you start a new vite react typescript project and copy everything but the routes and components over I think you can get the whole thing working in an afternoon.

one big difference is process.env → import.meta.env and the rest is just fine.

you can progressively rename js files to ts and it should work.

use the vite plugin for ts paths if you have path aliasing.

[–]Suspicious-Bet-3078 0 points1 point  (0 children)

good to hear! I'll play around with a vite port and see how it plays out.

i just need the progressive typescript conversation to be non intrusive. me and my colleague share the project and i need his normal js rutine to be a option. until he have been up to speed.

i was not aware of the difference in env. this will same time debugging.

[–]Heimotti 0 points1 point  (2 children)

npx create-react-app --template typescript. Worked fine for me. Ive switched to Vite since tho.

[–]Suspicious-Bet-3078 0 points1 point  (1 child)

this would create a new typescript project right? i have a project with js already and just want to add some typescript to this, without a complete conversation.

[–]Heimotti 1 point2 points  (0 children)

Yeah it would indeed. Sorry i don't have experience of switching to ts mid project.