Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const createInstance = React.useCallback(() => {
destroyInstance()
const reference =
targetRef && isRefObject(targetRef)
? (targetRef as React.RefObject<element>).current
: (targetRef as _PopperJS.ReferenceObject)
if (!enabled || !reference || !contentRef.current) {
return
}
const pointerTargetRefElement = pointerTargetRef && pointerTargetRef.current
const scrollParentElement = getScrollParent(contentRef.current)
const popperHasScrollableParent = scrollParentElement !== scrollParentElement.ownerDocument.body
const modifiers: PopperJS.Modifiers = _.merge(
{ preventOverflow: { padding: 0 } },
{ flip: { padding: 0, flipVariationsByContent: true } },
/**
* This prevents blurrines in chrome, when the coordinates are odd numbers</element>