Conditionally rendering a component inside of <Draggable>, using react-draggable, is breaking the draggable functionality. Any ideas?

I’m trying to conditionally render a component inside another component that uses react-draggable. If my return function returns a div, dragging works fine. If my function returns SomeComponent, dragging breaks completely. I’ve tried React.forwardRef and attaching the ref to nodeRef on Draggable, and on the ref inside the component, but that doesn’t work. Is this… Read More Conditionally rendering a component inside of <Draggable>, using react-draggable, is breaking the draggable functionality. Any ideas?

React ForwardRef: Property 'current' does not exist on type 'ForwardedRef<HTMLElement>'

I am trying to create a component that will track the vertical scroll. The catch is – the actual scroll container is not easily predictable (in this specific case it is neither window, document nor body – it is div#__next, due to CSS overflow rules). I want to keep the component flexible and self-contained. So… Read More React ForwardRef: Property 'current' does not exist on type 'ForwardedRef<HTMLElement>'