#Interactive components natively in Astro

7 messages · Page 1 of 1 (latest)

shut badger
fierce turret
#

Great thank you @shut badger. Weird, as I was looking for it in the docs and missed it 😄 is it way more performante than using react components?

shut badger
#

It's much more lightweight, which helps on slower connections, and if you're doing anything computationally heavy, you can be very specific about how you rerender parts of your component, making it more performant in those cases too

#

It very much depends on your use-case though, but I don't see it ever being worse than react

slender oak
#

Like otterlord said, it really depends on what you're doing... for anything simple like "do-something-on-click" definitely use vanilla js, but if you're making a complex ui react will significantly reduce dev time... if bundle size is a concern ( or even if its not ) preact is lighter with same api.

fierce turret
#

Thanks guys 🙂 @slender oak @shut badger

spice flower
#

@fierce turret although I do not recommend to do that much with just astro and vanilla js, and for the sake of experimentation I created a whole home heating control GUI with astro, it is interactive even with live updates from the server https://github.com/MicroWebStacks/astro-home-control in other words, with Astro, you can do anything vanilla js and html can do, in easier way, but for such complexity, using UI frameworks can make it eaven easier.