Skip to content
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

Not working with react 18 and next js 12 getting element ref error #234

Open
rishabhtatia1 opened this issue Apr 19, 2022 · 14 comments
Open

Comments

@rishabhtatia1
Copy link

What is the current behavior?

Steps to reproduce it and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have extra dependencies other than react-scrollbars-custom. Paste the link to your JSFiddle or CodeSandbox example below:

What is the expected behavior?

A little about versions:

  • OS:
  • Browser (vendor and version):
  • React:
  • react-scrollbars-custom:
  • Did this worked in the previous package version?
@rishabhtatia1 rishabhtatia1 changed the title Not working with react 18 and next js 12 getting element ref Not working with react 18 and next js 12 getting element ref error Apr 19, 2022
@victorst79
Copy link

Same error here.

@proteye
Copy link

proteye commented May 23, 2022

I have same error. Please, fix it!

@egoarka
Copy link

egoarka commented Jul 3, 2022

This issue happens due to React.StrictMode. Temporary fix is to disable it.

@GorlikItsMe
Copy link

I have same issue. For me helped change reactStrictMode to false in next.config.js, but this should be fixed in different way.

Error:

Error: Element was not created. Possibly you haven't provided HTMLDivElement to renderer's `elementRef` function.

public componentDidMount(): void {
if (!this.element) {
this.setState(() => {
throw new Error(
"Element was not created. Possibly you haven't provided HTMLDivElement to renderer's `elementRef` function."
);
});
return;
}

@victorst79
Copy link

The latest release in the repository is from 2018 and the latest code push is from 2021 I think this repository is unmaintained.
To solve these problems use another library: react-custom-scrollbars-2
It is practically the same but you have to change the name of some parameters and it seems to have more maintenance and updates.

@xobotyi
Copy link
Owner

xobotyi commented Jul 13, 2022

I'm trying to cut the time to rework the package atm

@Hikikomori
Copy link

Any updates on this issue ? Still presents on the latest release
@xobotyi

@petertodorov
Copy link

Wondering if any updates that may fix the issue are upcoming?
@xobotyi

@nop33
Copy link

nop33 commented Jan 9, 2023

Facing the same issue...

rsc.esm.js:871 Uncaught Error: Element was not created. Possibly you haven't provided HTMLDivElement to renderer's `elementRef` function.

@hmidmrii
Copy link

same here

@AnnaLynxy
Copy link

I'm sorry, any updates? @xobotyi

@idosius
Copy link

idosius commented Mar 20, 2024

Plus one, also reproduced this, albeit without Next.js, rather with a client side application using React 18 and Vite 5.1

@vishnuur
Copy link

Same here, with react 18 and Vite 5.1. Any updates on this issue ?

@DarlingUUi
Copy link

I've got same issue in react 18. please let me know how to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests