Introduction
Similar, though not identical to my scenario:
- Situation 0: Imagine you have a container (chessboard with divs for game pieces) and a dead-pieces-view (container for defeated pieces). The positioning of these containers is determined by CSS rules and device/media parameters, managed by the browser.
- Situation 1: A piece is captured and needs to be smoothly transitioned from the board to the dead-pieces view in the correct location.
I can accurately identify the moving divs using unique ids/keys.
Additional Requirements: I am using React, so I anticipate that the smooth transition can be achieved simply by updating the rendering from State0 to State1. (Or, at the very least, with minimal imperative code additions)
Here is a link to my sandbox project: https://codesandbox.io/s/crazy-pasteur-lr4ku
Prior Attempts:
- I experimented with using react keys and ids to track the moving div. However, the issue was not specific to React; even manual movement of the div using pure JS (appendChild) did not result in a smooth transition.
- I also attempted to use react-pose as it seemed like a potential solution. Unfortunately, it appeared to be limited to animating ul/li elements exclusively, while other animated elements on the page remained independent from one another (or perhaps I did not fully explore the framework's capabilities).