filestack / filestack-react

Official React component for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://www.filestack.com
MIT License
164 stars 40 forks source link

React 18 support #132

Open adboio opened 1 year ago

adboio commented 1 year ago

It looks like this module only supports React 16, but we're on v18 now. Can we expect React 18 support soon?

KayakinKoder commented 1 year ago

Filestack seems to be going out of business. We switched to UploadCare

Wamy-Dev commented 1 year ago

Really? Going out of business?

phlare commented 1 year ago

Unless that is insider info, no I don’t think so.

On Mon, May 22, 2023 at 7:37 PM David @.***> wrote:

Really? Going out of business?

— Reply to this email directly, view it on GitHub https://github.com/filestack/filestack-react/issues/132#issuecomment-1558414677, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFJCBACYBT5OC7WKYXERQ3XHQPHBANCNFSM6AAAAAAVR6Q4AI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

KayakinKoder commented 11 months ago

No commits to main since Sept. 2021. We switched to Uploadcare. It's kind of amazing that a company named _File_stack doesn't update their primary file uploader for years on end

Californian commented 11 months ago

This is unmaintained, switching to Uppy (they have a much more sane react implementation than uploadcare).

ivantokar commented 11 months ago

As for me the best way do not use the FileStack as React component. I have used the common JS library JavaScript SDK in my React app

JavaScript File Picker Doc

I created a simple hook for my needs and it works well

import * as filestack from 'filestack-js'
import './picker.css'

function useFileUploader(options: filestack.PickerOptions) {
    const initialOptions = {
        fromSources: ['local_file_system'],
        maxSize: 3024000,
        maxFiles: 1,
        minFiles: 1,
        uploadInBackground: true,
        onClose: () => picker.close(),
        onCancel: () => picker.close(),
    }

    const client = filestack.init(FILE_STACK_API_KEY)
    const picker = client.picker({ ...initialOptions, ...options })

    /* ... */

    return {
        picker
        /* ... */
    }
}

Use useFileUploader in another component

const UploadFile: React.FC = () => {
    const { picker } = useFileUploader({
        accept: ['image/*'],
        transformations: {
            crop: true,
            rotate: true,
        },
        onUploadDone: (result) => onUploadDone(result),
    })

    /**
     * Handle a success uploading result
     *
     * @param result
     */
    const onUploadDone = async (result) => {
        picker.close()
        /* ... */
    }

    return (<button onClick={() => picker.open()}>Add</button>)
}

Uninstall and forget about this repository 🙂