ProjectMirador / mirador-annotations

a Mirador 3 plugin that adds annotation creation tools to the user interface
https://mirador-annotations.netlify.app/
38 stars 37 forks source link

Window flickers when another plugin wraps the window component #41

Closed charbugs closed 3 years ago

charbugs commented 3 years ago

When loading Mirador with the annotation plugin and another plugin that wraps the window component then the window flickers when the annotation panel is open.

I wasn't able to compile Mirador with the annotation plugin on Stackblitz and Codesandbox so I set up a repository to demonstrate the problem: https://github.com/charbugs/mirador-annotation-plugin-issue

The flickering happens when you move the mouse over the image or the annotation list items. I noticed that without the test plugin only HOVER_ANNOTATION actions are dispatched but with the test plugin UPDATE_VIEWPORT action are dispatched in addition.

The test plugin only renders the next component via <TargetComponent {...targetProps} /> so I assume it does not disturb the annotation plugin. Also the test plugin does not trigger rerendings by itself. React.memo didn't work either.

Any ideas?