#Hot Reload doesn't seem to work with .tsx files when classNames are changed
3 messages · Page 1 of 1 (latest)
Hi @lucid jewel. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Astro uses Hot Module Replacement (HMR) to update your browser as you save changes in your editor when running Astro's development server using the astro dev command source (https://docs.astro.build/en/reference/cli-reference/#astro-dev).
However, if you're working with TypeScript files, it's important to note that Astro doesn't perform any type checking itself. Type checking should be taken care of outside of Astro, either by your IDE or through a separate script. For type checking Astro files, the astro check command is provided source (https://docs.astro.build/en/guides/imports/#typescript).
If you're experiencing issues with hot reloading not working with .tsx files when classNames are changed, it might be due to the way you're importing your files. In Astro v0.21+, files need to be referenced by their actual extension, exactly as it is on disk source (https://docs.astro.build/en/guides/upgrade-to/v1/#file-extensions-in-imports).