react-resizable
react-resizable copied to clipboard
Resizable has no `ref` in props interface
Thanks for opening an issue!
Please select the type of issue you're reporting. For questions.
- [ ] Bug
- [X] Feature Request
- [ ] Question
Problem Report
Resizable has no
ref
in the props interface, so it's impossible to get a hold of the internal element for effects such as calculating dimensions in runtime. It would be nice to have aref
prop included in both Resizable and ResizableBox components and be passed down to the container element.
Example:
import React, {useRef} from 'react'
export default (props) => {
const ref = useRef()
<Resizable defaultSize={{width: 650, height: 350}} ref={ref}>
...
</Resizable>
}
I assume you are passing the child element yourself. Why not attach the ref
to that?
import React, {useRef} from 'react'
export default (props) => {
const ref = useRef()
<Resizable defaultSize={{width: 650, height: 350}}>
<div ref={ref}>Some box</div>
</Resizable>
}
Hello, is this something that is being worked on, or? Because I would love this feature.