TSX and then just make sure that this is TSX as well. There you go. TypeScript works out of the box, right? And we can say, add props here. Now just testing, probably, here at the edit list. Yeah, should work. So, there you go, a bit vanilla, a little bit, and then we manage to convert it to react and react TypeScript.
So, maybe I can show you something about a project, a large project, it's using here. Oh, yeah, it's already. It's a big CLA project and converted to bit, but it was just a copy. So, I had to do some editing because I don't want to see the whole application. So, I just made here, what I call this, position absolute, left 8000. So, technically, or basically, the UI moved a few meters to the left and now I see a bit, hello, React.js. So, before it, it takes 3-4 seconds to see the changes in CRA. And then, once you move it to, after moving it to, it's like instant, less than a sec.
Okay, so requirement. Um, of course, you need to install the VIP package and then add necessary plug in. I mean, not necessary, sorry. Um, just, I have to add TSConfigPath because I'm using base URL or base source here. So you can see, TSConfig.json to the base URL here. So I need that plugin to work here. Uh, you can, you know, if you encounter any errors, you can just Google it and see, it will end up in a documentation or, you know, teaches you how to fix it using plugin and ReactJS X here so that you don't need to, um, explicitly write import React. Um, what else for this is, uh, technically this is a React TypeScript. So I'm adding global.js here, reference type to a Viet client, or you don't have to do this if you have this type's Viet client here. So yeah.
Um, there you go. So one thing here I'd like to share that if you're, you have a large React, um, yeah, project and files. The files are in JavaScript, not in JSX. You can, you don't have to manually convert them one by one. You can write a Python, you can run a Python script and then this script will just convert all the JS file into JSX in a few seconds, one, two, done. Um, yeah.
Comments