chatmosphere-app
chatmosphere-app copied to clipboard
Re-rendering of PanWrapper
I found out, that my jumping bug had to do with the PanWrapper being re-rendered on state changes (for example: joining of new users, name change) https://github.com/Chatmosphere/chatmosphere-app/blob/0c90e375223d4fae086ef96159da82dafa4c4905/src/components/PanWrapper/panOptions.ts#L20
The fix was to remove scale, positionX, positionY from the panWrapperOptions, since they were resetting the users panning on each re-render of the component.
I am not sure why it is no issue with out my additional Layers in the master branch, but I would recommend to remove all three from the options or further investigate what's causing the re-renders and their relation to the store update.
interesting, I'll check. Maybe it's rerendering but not redrawn and thus has no effect in our setup. I'll investigate, thx for the info 🙏