DioxusLabs / DioxusLabs/dioxus

MountedData does not properly being updated after rerendering.

Open
#2,420 3 comments 1 reaction 0 assignees View on GitHub
consistency desktop needs reproduction
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

`MountedData` is the structure that provides `get_client_rect` function to get position and size of the element.
It can be stored somewhere by cloning `Rc` from the `onmounted` callback.
The `Rc` should point exact same element or the `onmounted` callback should be called after the re-render

**Steps To Reproduce**

- Use onmounted and store MountedData somewhere else.
- Try re-render the element
- Call `MountedData::get_clinet_rect()` function. It will cause panic.

**Expected behavior**

The stored `Rc` should return values properly. or the callback registered on the `onmounted` should called after re-rendering.

**Environment:**
- Dioxus version: `0.5.1`
- Rust version: `1.77.2`
- OS info: `Windows`
- App platform: `Desktop`

**Questionnaire**

- [x] I'm interested in fixing this myself but don't know where to start
- [ ] I would like to fix and I have a solution
- [ ] I don't have time to fix this right now, but maybe later

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.