React Hooks - Async Stripe Provider

26 Sep 2019

I love Stripe’s API and their react-stripe-elements library, but I don’t love having to synchronously load the stripe.js file, especially since there’s realistically no way my users will be using Stripe functionality within 1 second of page load!

They have options for loading their script asynchronously, but none of them used hooks… so I wrote my own.

Enjoy :)