UNPKG

@base-org/account-ui

Version:
25 lines 810 B
import { createElement, useEffect, useRef } from 'react'; import { mountBasePayButton, unmountBasePayButton } from '../preact/mountBasePayButton.js'; export const BasePayButton = (props) => { const ref = useRef(null); useEffect(() => { if (ref.current) { // Clone props to avoid extensibility issues between React and Preact const clonedProps = Object.assign({}, props); mountBasePayButton(ref.current, clonedProps); } return () => { if (ref.current) { unmountBasePayButton(ref.current); } }; }, [props]); return createElement('div', { ref, style: { display: 'block', width: '100%', }, }); }; //# sourceMappingURL=BasePayButton.js.map