littlechad
littlechad

Reputation: 1228

React-dropzone is directly opening gallery instead of list of apps

I am implementing React-dropzone on a Next Js PWA project, as follows

# lib/hooks/use-upload.tsx

...
import { useDropzone } from 'react-dropzone'
...

export const useUpload = ({ maxSize = 10 * 1024 * 1024 }: Props) => {
  ...

  const { getInputProps, getRootProps } = useDropzone({
    accept,
    maxFiles: 1,
    maxSize,
    onDrop: async (files) => {
      ...
    },
    onError: (e) => {
      ...
    },
  })

  return {
    getInputProps,
    getRootProps,
    ...
  }
}

# components/upload-button.tsx

'use client'

...
import { useUpload } from '@/lib/hooks/use-upload'

function Component() {
  const {
    getInputProps,
    getRootProps,
  } = useUpload()

  return (
    ...
    <div {...getRootProps()} ...>
      <input {...getInputProps()} />
      ...
    </div>
    ...
  )
}

export default Component

And when i click the button on mobile chrome browser, the one's popping up is the following gallery gallery

Instead of the regular "Choose an action" like the ones's on the example page (opened on the same browser as the above) enter image description here

Googled and going through the documentation for solution without any luck, is there something that i missed?

Upvotes: 0

Views: 38

Answers (0)

Related Questions