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

Listen to children's change in src= #4

Open
lourot opened this issue Jun 6, 2023 · 0 comments
Open

Listen to children's change in src= #4

lourot opened this issue Jun 6, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@lourot
Copy link
Member

lourot commented Jun 6, 2023

<ImageDisplayControl>
  <Image src=... />
</ImageDisplayControl>

In case the child's src= is constructed for example based on its state, updated later asynchronously by a useEffect(), we (the parent <ImageDisplayControl>) won't notice the change, and so we won't fetch the new image regions corresponding to the new image.

How to solve this? With a MutationObserver? With some kind of subscription to the children's React states?

@lourot lourot added the enhancement New feature or request label Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant