react-component / slider

React Slider
https://slider.react-component.now.sh/
MIT License
3.02k stars 762 forks source link

Error while using with Astro.js #887

Open hemandev opened 1 year ago

hemandev commented 1 year ago

I am getting an error while using rc-slider with Astro.js

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

The issue is only happening if I use the client:load directive from astro, which initially renders the component on server and then hydrates it on the client. Its working fine if client:only is used

Link to CodeSandbox

hemandev commented 1 year ago

I'm guessing that the root cause might be because of forwardRef. I just forked the repo and exposed another named export without forwardRef and it's working. I can raise a PR if you're open to the fix

yoyo837 commented 1 year ago

PR welcome.

pythonpioneer commented 10 months ago

@hemandev Yes, the error was caused by forwardRef.