iicaptain
iicaptain

Reputation: 1195

Equivalent of React's useLayoutEffect in Svelte

I'm porting a React hook to Svelte 4. The hook uses React's useLayoutEffect. According to the React docs:

useLayoutEffect is a version of useEffect that fires before the browser repaints the screen.

Is there an simple way to replicate this functionality in Svelte either through a built in utility or with a custom function?

Upvotes: 0

Views: 162

Answers (1)

iicaptain
iicaptain

Reputation: 1195

The closest equivalent is Svelte's onMount function.

Upvotes: -1

Related Questions