filestack-react
filestack-react copied to clipboard
Once closed it cannot be reopened
What I am trying to do is display a picker overlay on a button click. Once the Overlay appears and a user mistakenly closes it, there is no option to re-render it.
I have already tried onClose but it does not matter if my local variable is set to false. The component does not appear.
Any help would be appreciated..
import { PickerOverlay } from 'filestack-react';
function MyComponent(): JSX.Element {
const [isOpen, setIsOpen] = setState<boolean>(false);
const pickerOptions = {
onClose,
};
function onClose() {
setIsOpen(false);
}
function open() {
setIsOpen(true);
}
return (
<>
{ isOpen && (
<div style="position:absolute">
<PickerOverlay apiKey={MY_KEY} pickerOptions={pickerOptions} />
</div>
)}
<button onClick={open}>Upload</open>
</>
);
}
Wish this was an example in the readme.