@proca/widget
Version:
Proca is an open-source campaign toolkit designed to empower activists and organisations in their digital advocacy efforts. It provides a flexible and customisable platform for creating and managing online petitions, email campaigns, and other forms of di
26 lines (21 loc) • 551 B
JavaScript
import React, { useRef, useImperativeHandle } from "react";
const StripeInput = props => {
const elementRef = useRef();
const Component = props.component;
useImperativeHandle(props.inputRef, () => ({
focus: () => elementRef.current.focus,
}));
if (!props.stripe) {
console.log("waiting for stripe");
return null;
}
return (
<Component
stripe={props.stripe}
//supportedCountries={["FR"]}
onReady={element => (elementRef.current = element)}
{...props}
/>
);
};
export default StripeInput;