useProducts
useProducts
useProductsUsage
import { useProducts } from '@billing-js/react-billing-js'
function MyComponent(props) {
const { products, pricingFilter, loading } = useProducts(activeStripeProducts, {
modal: {
maskClassName: 'bg-white fixed inset-0 bg-opacity-75 transition-opacity backdrop-blur-sm',
showPromotionCodeInput: true,
},
defaultCustomerName: 'userName',
normalizePriceOnRecurrence: 'monthly',
defaultCurrency: 'usd',
defaultRecurrence: 'yearly',
onPaymentSuccessful: () => history.push('/app/?welcome-to-premium'),
onPaymentError: () => console.log(`Payment error`),
})
// render the component using the products, pricingFilter, and loading values
}Arguments
Returns
Last updated