Thank you to @happydev on the Astro discord who was able to figure
this out.
Create a component called Toastify.tsx
The Toastify
component takes another component as its argument and
returns it with a Toaster
component imported from react-hot-toast
.
Export the Toastify
component with the Button
as its argument.
Create a function to trigger the toast
Set the client directive to client:load
If there is no client directive the HTML will be rendered without
JavaScript.
Reference
Final Result