In this episode of my React Hooks Tutorial, we will learn about the useDebugValue and useLayoutEffect hooks. The useDebugValue hook allows us to set a label for our custom hook in the React DevTools and the useLayoutEffect hooks allow us to reliably access and adjust DOM just before the browser paints it to the screen. This means that the useLayoutEffect hooks is the ideal place for adjusting styles and scroll values or similar things. We will also discuss the differences between the useEffect and useLayoutEffect hooks.
Starting repository:
https://github.com/philipfabianek/rea...
Ending repository:
https://github.com/philipfabianek/rea...
Timestamps:
►0:00 Introduction
►0:27 Implementing the useDebugValue hook
►1:14 useEffect vs useLayoutEffect
►1:48 Implementing the useLayoutEffect hook
►3:02 Ending
Social Media:
►Twitter: / philip_fabianek
►LinkedIn: / philip-fabianek
►Website: http://www.philipfabianek.com
►GitHub: https://github.com/philipfabianek