Skip to content

Commit

Permalink
use popperOptions in usePopper (react-bootstrap#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor_the_great committed Dec 11, 2019
1 parent 4709d00 commit c56c30c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/usePopper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -85,7 +84,7 @@ export default function usePopper(
};

popperInstanceRef.current = new PopperJS(referenceElement, popperElement, {
...options,
...popperOptions,
placement,
positionFixed,
modifiers: {
Expand Down

0 comments on commit c56c30c

Please sign in to comment.