# withHooks

this was HigherOrderComponent for use hooks.

```jsx
import React from 'react';
import { withHooks, useDragPreview } from '@zohodesk/react-dnd';

class MyDragPreview extends React.Component {
  render() {
    const { positionStyle, content, canShow } = this.props;
    if (!canShow) {
      return null;
    }
    return (
      <div style={positionStyle} className={'som styles'}>
        {content}
      </div>
    );
  }
}

export default withHooks((props) => {
  const [dragPreviewProps] = useDragPreview();
  const { isDragging, dragElementInfo, positionStyle } = dragPreviewProps;

  return {
    positionStyle,
    content: dragElementInfo.content,
    canShow: !isDragging || !hideDragImage,
  };
}, true)(MyDragPreview); // here we send component
```
