Skip to content

Commit 2886477

Browse files
feat: implement componentWillUnmount function to pass the test
1 parent e6088d1 commit 2886477

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ const useLifecycleHelpers = (state = {}, props = {}) => {
9090
* @param {Function} callback
9191
*/
9292
const useComponentWillUnmount = callback => {
93-
93+
useEffect(() => {
94+
return () => {
95+
callback()
96+
}
97+
// eslint-disable-next-line
98+
}, [])
9499
}
95100

96101
return {

0 commit comments

Comments
 (0)