Wrap your app

Import Billing.js CSS classes

The Billing.js imports already-styled React components for you to import into your app directly.

Those components are styled with Tailwindarrow-up-right so you will need to import those classes.

circle-info

If you are using Tailwindarrow-up-right in your app too, make sure to add the Billing.js source code to your Tailwind config. More info

App/ index.tsx - Root component of your react app

import React from "react"
import { render } from "react-dom"
import { BillingProvider } from "@billing-js/react-billing-js"

// ...

// /!\ import the billing.js styles
import "@billing-js/react-billing-js/styles.css"
// /!\ import the billing.js styles

// ...

Wrap with the context provider

Wrap your App with the <BillingProvider /> component to give it access to the Billing.js context.

App/ index.tsx - Root component of your react app

Last updated