DioxusLabs / DioxusLabs/dioxus

Request for `useLayoutEffect` for the web renderer

Open
#2,433 1 comment 0 reactions 0 assignees View on GitHub
enhancement hooks
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

## Background

I'm building a prototype Dioxus web app using absolute positioning. There are many divs that need to know their dimensions to prevent overlaps. (You could imagine that I'm using a force-directed layout if it helps visualize what I'm doing, but I'm not actually using that particular layout algorithm.) For this application, it would be ideal to wait until [layout] finishes but before [painting] starts. React has `useLayoutEffect`. If Dioxus had this, it would seem like the ideal thing to use.

[layout]: https://developer.mozilla.org/en-US/docs/Web/Performance/How_browsers_work#layout

[painting]: https://developer.mozilla.org/en-US/docs/Web/Performance/How_browsers_work#paint

## Feature Request

Please add `useLayoutEffect` for the web renderer for Dioxus.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.