Benjamin den Boer@benjamindenboer
Niels van Hoorn@nvh
Jorn van Dijk@jornvandijk
How to deal with Animate Presence within a Stack? (Need a CSS Hero)July 14, 2020 at 4:40pm
- I'm trying to use Animate Presence, but it lives within a stack. In the half-second the entering and exiting child are both mounted it forces it into a layout row which makes the animation hop around.
- I tried to use a Frame, but I wanted to use Stack because it can fit-content. When I use the frame the width automatically shrinks to 0.
- If I try to use a frame, what's not shown here is that the children could be any length of text which is hard to calculate before it hits the DOM.
July 15, 2020 at 9:26pm
replied in workplace :) I'll look into seeing if there is a bug here / if there is another approach without needing to separately add framer-motion
For anyone else stumbling upon this -> an approach that works:
- hiding some 0 opacity text to stabilize the resizing
- using the new framer-motion
layoutprop for scale distortion correction