react-image-display-control icon indicating copy to clipboard operation
react-image-display-control copied to clipboard

Listen to children's change in `src=`

Open lourot opened this issue 2 years ago • 0 comments

<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 avatar Jun 06 '23 21:06 lourot