---
title: "Discussion on \"useEffect vs. useLayoutEffect\" | Hashnode"
description: "Discussion on \"useEffect vs. useLayoutEffect\". Question : I'm wondering, if we could use useLayoutEffect instead of useEffect here as well.\nAnswer:\nuseLayoutEffect runs before the useEffect hook. This is because the useLayoutEffect is fired synchronously after DOM gets mutated and before the brow..."
url: "https://hashnode.com/posts/useeffect-vs-uselayouteffect/6452b4ff80be5850b9346ed6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [useEffect vs. useLayoutEffect](https://omarsaade.hashnode.dev/useeffect-vs-uselayouteffect?utm_source=hashnode&utm_medium=feed)

Question : I'm wondering, if we could use useLayoutEffect instead of useEffect here as well. Answer: useLayoutEffect runs before the useEffect hook. This is because the useLayoutEffect is fired synchronously after DOM gets mutated and before the brow...

May 3, 2023 · 1 min read · omarsaade.hashnode.dev  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#react-native](https://hashnode.com/tag/react-native)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#hooks](https://hashnode.com/tag/hooks)

## Written by

[Omar Saade](https://hashnode.com/@os921)

@os921

  
[View profile](https://hashnode.com/@os921)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
