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

onChange doesn't fire on initial render #527

Closed
meirish opened this issue Jun 16, 2022 · 1 comment · Fixed by #537
Closed

onChange doesn't fire on initial render #527

meirish opened this issue Jun 16, 2022 · 1 comment · Fixed by #537
Labels
bug Something isn't working

Comments

@meirish
Copy link
Contributor

meirish commented Jun 16, 2022

I'm not sure if this is related to #10 or not, but we recently found that a hard refresh of our app on a page that renders at least one portal does not call the onChange function that's passed to PortalTarget. We worked around this by moving our updating to use the yielded count which does have the right value.

Is this a bug or intended behavior?

@simonihmig
Copy link
Owner

Hm, sounds like a bug. Thanks for reporting!

There is a test for onChange, but it is only covering the delayed case, not an initial render that already has an active portal.

If you have the time, a PR with such a (failing) test case would help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants