How `<Resizable>` and `<ResizableBox>` work together
masterThe package provides two main components for different use cases:
<Resizable>: A raw, stateless component. It acts as a building block. You are responsible for managing the state (width/height) and passing it back into the component via callbacks likeonResize.<ResizableBox>: A high-level component that wraps a<div>. It manages its own basic state, making it much simpler for standard use cases where you just want a resizable container.
Use <Resizable> when you need fine-grained control over the resizing logic or when integrating with complex state management. Use <ResizableBox> for quick, self-contained resizable elements.
// Example of the stateless <Resizable>
<Resizable
height={this.state.height}
width={this.state.width}
onResize={this.onResize}
>
<div style={{width: this.state.width + 'px', height: this.state.height + 'px'}} />
</Resizable>
// Example of the stateful <ResizableBox>
<ResizableBox
width={200}
height={200}
minConstraints={[100, 100]}
>
<div>Contents</div>
</ResizableBox>