MediaSingle re-renders causing flashing / flickering image

Hi devs,

I’m rendering ADF of user-generated content that contains MediaSingle nodes inside Atlaskit Tabs with Atlaskit Renderer, the images can be displayed correctly but there’s an issue of the images being re-rendered whenever users switch tabs thus causing the images appear to be flickering / flashing.

Attempted solutions include not allowing users to insert MediaSingle but that means losing features offered by it, e.g. resizing and repositioning images. Atlaskit has a “extensionHandlers” prop that seems like it could allow custom rendering of nodes but after diving a little into the code, it seems to always use a built-in MediaSingle component to render the node. The current attempt is to memoise the rendered content but at the same time I’d like to raise the issue here to see if anyone has run into this before, any idea? Thanks in advance.

Update 10 days later:

If anyone ran into the same issue, memoize the rendered content doesn’t seem to help, there seems to be something a WidthConsumer component wrapped around the media that causes it to response to DOM changes.