Skip to content

Commit ca288fa

Browse files
feat: implement componentDidMount function to pass the test
1 parent e6783b1 commit ca288fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ const useLifecycleHelpers = (state = {}, props = {}) => {
1616
* @param {Function} callback
1717
*/
1818
const useComponentDidMount = (callback) => {
19-
19+
useEffect(() => {
20+
callback()
21+
// eslint-disable-next-line
22+
}, [])
2023
}
2124

2225
/**

0 commit comments

Comments
 (0)