Skip to content

Commit

Permalink
fix: use useEffect for non-blocking behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictwlee committed Apr 21, 2020
1 parent 599ae07 commit aa4203b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/usePopper.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import {
useRef,
useCallback,
useLayoutEffect,
useEffect,
useState,
Ref,
} from 'react';
import { useRef, useCallback, useEffect, useState, Ref } from 'react';
import { createPopper, Options, Instance } from '@popperjs/core';
import { useForkRef } from './refUtils';

Expand Down Expand Up @@ -53,7 +46,7 @@ export default function usePopper(props: usePopperProps) {
};

// Recreate on popper change
useLayoutEffect(() => {
useEffect(() => {
create();

return () => {
Expand Down

0 comments on commit aa4203b

Please sign in to comment.