Open haris316 opened 2 years ago
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.
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..