There are two hooks in React, useEffect and useLayoutEffect, which appears to work similarly. The way you call them seems the same: useEffect(() => { // side effects return () => /* cleanup */ }, [dependency, array]); useLayoutEffect(() => { /...

Markdown supported · ⌘↵ to post
No responses yet.