1. 17
    Refactor a React Astro Island to Vanilla JS to Ship Less JavaScript
    7m 57s

Refactor a React Astro Island to Vanilla JS to Ship Less JavaScript

InstructorLazar Nikolov

Share this video with your friends

Send Tweet

One of the beauties of Astro is that you don't need to use a JavaScript UI library. Astro lets you us plain JavaScript when you want to.

It's a good idea to get into the habit of starting with vanilla JS when you have a simple use-case like adding a like button. This will mean less JavaScript on the page for your user than if you were to implement this in React.

We'll refactor our React like button and turn it into vanilla JS with the result for the user. Another added benefit of this approach is you'll get more familiar with the native browser API which will pay dividends for you in the future.