chargebee-js-wrappers
chargebee-js-wrappers copied to clipboard
Add error handler when calling load('components')
Problem
Currently the react-wrapper doesn't allow to handle an error when calling load
with an incorrect config.
If we do a init of a wrong config:
const chargebeeInstance = Chargebee.init({
site: "site-name2", // wrong site
domain: "https://mybilling.acme.com" // this is an optional parameter.
publishableKey: "test__"
})
and we want to instantiate a CardComponent
The CardComponent will still be created even with a wrong configuration
Proposal
To allow the client to handle the error properly. Maybe having an onError
handle event and a fallback component to render a custom error component in the render