How does Vite compile JSX in development?

I’m new to backend. I want to make a server serves up a React app, without using Vite (or CRA). On front-end I’m using React, on back-end I’m using nodemon + express. I’m confused about how JSX got understood on the browser. This is my index.html: <body> <div id="root"></div> <script type="module" src="/src/main.jsx"></script> </body> When I… Read More How does Vite compile JSX in development?

Page not changing onClick using useNavigate in React?

I have a very basic UI for a login page: Upon clicking the LOGIN button, the following methods gets called: async function loginPatient(){ let item ={username:userName, password}; let result = await fetch("http://localhost:8000/users/login&quot;,{ method:’POST’, headers:{ "Content-Type":"application/json", "Accept":"application/json" }, body: JSON.stringify(item) }); alert(result); alert("breakpoint") result = await result.json(); localStorage.setItem("user-info",JSON.stringify(result)); nav(‘/patient’) } At this point I simply want… Read More Page not changing onClick using useNavigate in React?