Reputation: 1228
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
Instead of the regular "Choose an action" like the ones's on the example page (opened on the same browser as the above)
Googled and going through the documentation for solution without any luck, is there something that i missed?
Upvotes: 0
Views: 38