-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhandled Rejection (TypeError): Cannot read property 'scrollTop' of null #265
Comments
I am facing similar issue, is there any update on this ? |
Same here |
me too |
It seems like this issue happens on material-ui v5 - but works ok on v4. |
Is there an update on this or maybe a workaround? I am using functional components and just when the snackbar is supposed to appear I get the error message in the console: Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()? I am not using refs anywhere in my app. Thank you. |
Hello, I had the bug in a class component as well: class MyComponent extends React.Component {
render(): JSX.Element {
return <DropzoneArea
acceptedFiles={['image/png', 'image/jpeg']}
dropzoneText='Drag an image file or click'
onChange={(files): void => { console.log(files); }}
/>;
}
} It works fine at first, but as soon as you add a file, it crashes with the error:
I found that the error doesn't occur when you disable the alerts like this: class MyComponent extends React.Component {
render(): JSX.Element {
return <DropzoneArea
acceptedFiles={['image/png', 'image/jpeg']}
dropzoneText='Drag an image file or click'
onChange={(files): void => { console.log(files); }}
showAlerts={false} // <--- here
/>;
}
} So, I guess that can be a workaround until the issue is solved. |
Any ETA for #298 release? Either this or a |
showAlert={false} allows for functionality in material-ui v5, but curious when we will get update for fully supported material-ui v5? I found that just changing all the import paths to the new material-ui v5 allows this library to work, but this is the only issue I have come across. Any insight to timeline would be helpful. |
Bug Report
There seems to be some issue while using the dropzone in function components.
Most probably with the snackbar thingy as the file seems to be attached before crashing
Steps to reproduce
Just try to paste the basic example in a function component and select a file.
The file appears in the console and right after the app crashes.
Expected behavior
Watch the file attached properly and a snackbar message appear (?).
Versions
Packages installed:
Additional context
Full trace of console errors received:
index.js:1 Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
utils.js:2 Uncaught TypeError: Cannot read property 'scrollTop' of null
index.js:1 The above error occurred in the component:
asyncToGenerator.js:6 Uncaught (in promise) TypeError: Cannot read property 'scrollTop' of null
The text was updated successfully, but these errors were encountered: