# wp-ultimate-post-grid/3.9.0/assets/js/shared/Tooltip.js

WP Ultimate Post Grid, version 3.9.0. 41 lines.

- Page: https://pluginprobe.com/plugins/wp-ultimate-post-grid/3.9.0/code/assets/js/shared/Tooltip.js
- Raw: https://pluginprobe.com/plugins/wp-ultimate-post-grid/3.9.0/raw/assets/js/shared/Tooltip.js
- Modified: 2020-01-24T07:47:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-ultimate-post-grid/3.9.0/code/assets/js/shared/Tooltip.js#L10-L20`.

```javascript
import React from 'react';

import { Tooltip } from 'react-tippy';
import 'react-tippy/dist/tippy.css'

const OurTooltip = (props) => {
    if ( ! props.content ) {
        return props.children;
    }

    const style = props.hasOwnProperty( 'style' ) ? props.style : {};

    return (
        <Tooltip
            html={
                <div
                    dangerouslySetInnerHTML={ { __html: props.content } }
                />
            }
            popperOptions={ {
                modifiers: {
                    addZIndex: {
                      enabled: true,
                      order: 810,
                      fn: data => ({
                        ...data,
                        styles: {
                          ...data.styles,
                          zIndex: 100000,
                        },
                      })
                    }
                }
            } }
            style={ style }
        >
            { props.children }
        </Tooltip>
    );
}
export default OurTooltip;
```
