From c56c30c29b6d3edb3da44a614000aa99fd543c4f Mon Sep 17 00:00:00 2001 From: Viktor_the_great Date: Wed, 11 Dec 2019 18:52:00 +0300 Subject: [PATCH] use popperOptions in usePopper (#748) --- src/usePopper.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/usePopper.js b/src/usePopper.js index c67fe2d7..24c57d3b 100644 --- a/src/usePopper.js +++ b/src/usePopper.js @@ -28,16 +28,15 @@ const initialArrowStyles = {}; export default function usePopper( referenceElement, popperElement, - options = {}, -) { - const { + { enabled = true, placement = 'bottom', positionFixed = false, eventsEnabled = true, modifiers = {}, - } = options; - + ...popperOptions + } = {}, +) { const popperInstanceRef = useRef(); const hasArrow = !!(modifiers.arrow && modifiers.arrow.element); @@ -85,7 +84,7 @@ export default function usePopper( }; popperInstanceRef.current = new PopperJS(referenceElement, popperElement, { - ...options, + ...popperOptions, placement, positionFixed, modifiers: {