react-scrollbars-custom icon indicating copy to clipboard operation
react-scrollbars-custom copied to clipboard

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

Open rishabhtatia1 opened this issue 3 years ago • 15 comments

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 avatar Apr 19 '22 07:04 rishabhtatia1

Same error here.

victorst79 avatar May 03 '22 06:05 victorst79

I have same error. Please, fix it!

proteye avatar May 23 '22 09:05 proteye

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

egoarka avatar Jul 03 '22 13:07 egoarka

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.

https://github.com/xobotyi/react-scrollbars-custom/blob/6f9e391f30e191f20cf7603201ce7664e12dde01/src/ScrollbarTrack.tsx#L22-L30

GorlikItsMe avatar Jul 13 '22 09:07 GorlikItsMe

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.

victorst79 avatar Jul 13 '22 09:07 victorst79

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

xobotyi avatar Jul 13 '22 09:07 xobotyi

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

Hikikomori avatar Aug 22 '22 07:08 Hikikomori

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

petertodorov avatar Sep 14 '22 11:09 petertodorov

facing this problem as well @xobotyi

dvakatsiienko avatar Sep 17 '22 10:09 dvakatsiienko

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.

nop33 avatar Jan 09 '23 16:01 nop33

same here

hmidmrii avatar Jan 23 '23 15:01 hmidmrii

I'm sorry, any updates? @xobotyi

AnnaLynxy avatar Jan 27 '23 01:01 AnnaLynxy

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

idosius avatar Mar 20 '24 09:03 idosius

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

vishnuur avatar Apr 25 '24 05:04 vishnuur