Govur University Logo
--> --> --> -->
...

If you need to change how something looks on the screen *right before* the computer draws it, so there's no flicker, which special React `use` tool should you use?



To change how something looks on the screen right before the computer draws it, thereby preventing any visible flicker, you should use the special React tool called `useLayoutEffect`. This hook executes its function synchronously after all Document Object Model (DOM) mutations have been applied by React, but crucially, *before* the browser has a chance to visually paint or render those changes to the screen. Because `useLayoutEffe....

Log in to view the answer



Redundant Elements