szchenghuang / react-transitions

A collection of animated transitions when React components enter or leave the DOM.
MIT License
35 stars 11 forks source link

integration with react-router #6

Open MikeDabrowski opened 7 years ago

MikeDabrowski commented 7 years ago

Since I love your work here I'd like to use it everywhere. Is there a way to integrate these transitions with react-router?

Simply merging these two together does not actualy work because route vanishes and transition can't kick in.

szchenghuang commented 7 years ago

When routes changes, components associated with the previous route unmount and those with the coming route mount in general. From this angle it should be possible, since ReactTransitionGroup handles component leaving/entering the DOM.

On the other hand, however, page size usually changes with routes . Since this package has its limitation with respect to dynamic component size as stated in #3, integration with router comes with some limitation as well.

It would be nice if there is a demo on this, while my thought above could be vague. Hope I can find time to make one. Thanks for your feedback though.

MikeDabrowski commented 7 years ago

At this point I can't even make this work with router. As for resize problems I'd probably go and handle them with js.

Most problems would be solved if you could rewrite whole component to work without position absolute. Though that's probably not easy to do.