TylerBarnes / gatsby-plugin-transition-link

A link component for page transitions in gatsby
537 stars 70 forks source link

Page refresh with each link clicked #138

Closed geoffdgeorge closed 5 years ago

geoffdgeorge commented 5 years ago

I'm trying to work with AniLinks and the TransitionPortal to create a fixed navbar separate from the animation of the rest of my page, but each link clicked seems to refresh the page and re-lazy load my images as the rest of the page is animated. Is there a way to prevent this reload effect and keep the link animation?

Here's what the behavior looks like: Link_Flash_Sample

Also, here's a link to my repo, in case you want to try it yourself: https://github.com/geoffdgeorge/geoffdgeorge.com

TylerBarnes commented 5 years ago

Hey @geoffdgeorge , you should use a persistent layout for anything you want to persist across pages instead of transition-portal. The portal is good for if you need to render an animation element outside of the markup of the entering or exiting page. For example in anilink, the cover animation has a big block of colour that covers the page. Check https://transitionlink.tylerbarnes.ca/docs/installation/#usage-with-gatsby-plugin-layout for more info. Let me know if this doesn't solve your issue.

geoffdgeorge commented 5 years ago

Ah ha! Serves me right for not clicking through every link of the docs. Adding a resolve option worked beautifully. Thanks for your help!

TylerBarnes commented 5 years ago

Glad to hear that helped!