Skip to content

Commit

Permalink
Remove custom type in favor of DependencyList
Browse files Browse the repository at this point in the history
  • Loading branch information
scottybollinger committed Aug 27, 2020
1 parent a95dc48 commit 7d96b7c
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
* Sometimes we don't want to fire the initial useEffect call.
* This custom Hook only fires after the intial render has completed.
*/
import { useEffect, useRef } from 'react';
import { useEffect, useRef, DependencyList } from 'react';

type TInput = string | number | object | Function | boolean | null | undefined;

export const useDidUpdateEffect = (fn: Function, inputs: TInput[]) => {
export const useDidUpdateEffect = (fn: Function, inputs: DependencyList) => {
const didMountRef = useRef(false);

useEffect(() => {
Expand Down

0 comments on commit 7d96b7c

Please sign in to comment.