@uppy/react
Version:
React component wrappers around Uppy's official UI plugins.
21 lines (20 loc) • 751 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
// This file was generated by build-components.mjs
// ANY EDITS WILL BE OVERWRITTEN!
import { UploadButton as PreactUploadButton, } from '@uppy/components';
import { h as preactH, render as preactRender } from 'preact';
import { useContext, useEffect, useRef } from 'react';
import { UppyContext } from '../UppyContextProvider.js';
export default function UploadButton(props) {
const ref = useRef(null);
const ctx = useContext(UppyContext);
useEffect(() => {
if (ref.current) {
preactRender(preactH(PreactUploadButton, {
...props,
ctx,
}), ref.current);
}
}, [ctx, props]);
return _jsx("div", { ref: ref });
}