Use React Ref as bounds for useDrag hook. #647
              
                Unanswered
              
          
                  
                    
                      ashoktamang
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
As documented, [
Since v10 and for the drag gesture only, bounds can be a React ref or an HTMLElement, in which case the dragged element will be constrained to the element bounds (calculated with getBoundingClientRect).], I am trying to use parent's ref as bounds for my child components.Child components are custom components (and can be multiple) and are exported from different .tsx file. So, these components do not have access to parent ref. As far as I know, I need something opposite of
forwardRef.Any help would be appreciated. Highly appreciated if working example is provided. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions