question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get open function from ref when using useDropzone hook

See original GitHub issue

On latest version of react-dropzone v10.x.x

  • I want to triage a possible bug

What is the current behavior? When I’m calling

const { getRootProps, getInputProps, rootRef, inputRef } = useDropzone({
            accept,
            onDrop,
            multiple: false,
        });

Neither rootRef nor inputRef have a property called open. Is the open function for opening the file dialog from outside somewhere else?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
valoricDecommented, May 7, 2019

I just found out that is in the returned object of useDropzone. That probably should be mentioned in the Ref section of the readme, or?

0reactions
valoricDecommented, Sep 10, 2020

Was not easy to find the project from 1,5 years ago but I made it 😉 https://gist.github.com/valoricDe/712155a659d50b48f41b0d79a22d043e

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-dropzone
The useDropzone hook just binds the necessary handlers to create a drag 'n' drop zone. Use the getRootProps() fn to get the props...
Read more >
React js react-dropzone automatic opening when the page is ...
Through useImperativeHandle , that ref has one property which is upload -- a function that returns either an input element or null ....
Read more >
Examples - react-dropzone
The useDropzone hook just binds the necessary handlers to create a drag 'n' drop zone. Use the getRootProps() fn to get the props...
Read more >
react-dropzone - npm
You can either use the hook: import React, {useCallback} from 'react' import {useDropzone} from 'react-dropzone' function MyDropzone() ...
Read more >
React Dropzone and File Uploads in React - Upmostly
If you don't have an existing React project that uses the react-dropzone library, ... As an extra challenge, try to follow this tutorial...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found