0

I'm trying to facilitate a view transition where one large container component slides in from one side while the other slides out to the other.

I can get all of the discrete animations to work no problem with react motion, however, I'm at a loss as to how to handle both simultaneously.

Essentially, there is a point where both components inhabit the viewport simultaneously. I feel like my knowledge of CSS layout is inadequate to handle the problem properly.

My initial idea is to have the sliding elements absolutely positioned inside a relatively positioned container. However, this absolute positioning has side effects with respect to all the components contained inside of the absolutely positioned container.

This is a solved problem (iOS views slide back and forth all the time and retain layout behaviour when they pop into the view port).

If anyone could point me to a good resource for understanding this problem, or give me some general advice it would be appreciated. My main problem is that I don't know what topics to research or what books/online resources are good for explaining the solution to this type of problem.

MFave
  • 1,044
  • 2
  • 8
  • 19

1 Answers1

0

I've used a great package called react-transition that sounds like it handles the situation you mentioned. Check it out here: https://www.npmjs.com/package/react-transitions and you can see a demo here: https://szchenghuang.github.io/react-transitions/

Chase DeAnda
  • 15,963
  • 3
  • 30
  • 41
  • Thanks for this. I'm not sure how easy it is to control interpolated styles with this, but it definitely simplifies some other problems. – MFave May 27 '17 at 12:30