import Drop from 'react-drop';class App extends Component { state = { isOpen: false } render() { return( <div> <button ref="trigger" onClick={() => {this.setState({})}} > Trigger Content </button> <Drop target={this.refs.trigger} position="top" align="middle" > <div> <h2>Dropped Content</h2> <p>A paragraph to accompany the title.</p> </div> </Drop> </div> ) }}
Props
target: PropTypes.object
Accepts a DOM node which the Drop component is attached to. If getting undefined when using refs, try adding forceUpdate inside your trigger component's did mount lifecycle.
position: PropTypes.string
The position of the Drop component. Accepts top, right, bottom, or left.
align: PropTypes.string
How the Drop component is aligned. Accepts left, middle, right, top, or bottom.