Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for using use_memo with use_effect #2415

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pablosichert
Copy link

@pablosichert pablosichert commented May 15, 2024

This PR is a reproduction test case for #2416.

Currently, when starting with (0, 0) and writing

Write(Some(0), None)
Write(None, Some(0))
Write(Some(0), Some(0))
Write(Some(1), None)
Write(None, Some(1))
Write(Some(1), Some(1))
Write(Some(2), Some(2))
Write(Some(0), Some(0))

this test results in the following reads:

Read(0, 0)
Read(1, 1)
Read(1, 1)
Read(0, 0)
Read(0, 0)

However, the expected result is

Read(0, 0)
Read(1, 0)
Read(1, 1)
Read(2, 2)
Read(0, 0)

.unwrap();
});

None
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, interesting, if you change this line to:

Suggested change
None
rsx! {"{tuple:?}"}

The test passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant