I don’t know but vite was involved, looks like it was setting up live updates. This is part of the problem, you can’t just include a script apparently.
That’s just Vite’s dev mode. I think React is way overused but your example here is a bad one. You just weren’t aware what the dev tool was doing, it has nothing to do with the experience end users will have. It isn’t even anything to do with React.
Was it in Dev mode?
vite adds additional things to your page in dev so that it's easier to debug. when you are running it in production, it is just one js bundle & one css file.