-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from ImLunaHey/main
fix: incorrect hook types
- Loading branch information
Showing
5 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* eslint-disable react-hooks/exhaustive-deps */ | ||
import { useEffect } from "react"; | ||
|
||
export const useDidMount = (callback: VoidFunction | (() => VoidFunction)) => { | ||
export const useDidMount = (callback: () => void) => { | ||
useEffect(callback, []); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { useState } from "react"; | ||
|
||
export const useWillMount = (callback: VoidFunction) => { | ||
export const useWillMount = (callback: () => void) => { | ||
useState(callback); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* eslint-disable react-hooks/exhaustive-deps */ | ||
import { useEffect } from "react"; | ||
|
||
export const useWillUnmount = (callback: VoidFunction) => { | ||
export const useWillUnmount = (callback: () => void) => { | ||
useEffect(() => callback, []); | ||
}; |