Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function StripeCheckout(props) {
const { apiKey, src, LoadingIndicator, ErrorIndicator } = props;
const [loading, error] = useScript({
src,
});
if (loading) return ;
if (error) return ;
const handler = window.StripeCheckout.configure({
key: apiKey,
});
const children = React.cloneElement(props.children, {
onClick: event => {
event.preventDefault();
const options = getOptionsFromProps(props);
handler.open(options);
},
export default function GoogleMaps(props) {
const { api, children } = props;
const [loading, error] = useScript(getAttributes(api));
if (loading || error) return null;
return (
<>{children}
);
}