gatsby-using-page-transitions icon indicating copy to clipboard operation
gatsby-using-page-transitions copied to clipboard

Variant Exit not working.

Open didacus opened this issue 3 years ago • 1 comments

The initial and enter work perfectly. Unfortunately, the fade-out before going to another page does not happen. Any idea what might be causing that?

didacus avatar Jan 21 '21 08:01 didacus

Same happent here, also I couldn't run my project as I was getting "Cannot read property 'pathname' of undefined"

location props is only available in top-level components (pages). So if for some reason, you are reusing Layout component elsewhere and you are not providing (or it's not available) the location, it will break your code.

In your case, it seems that you are not providing the location at the 404 page. You can bypass it adding a default value such as:

const Layout = ({ children, location="" }) => ()

The ="" to location is the solution.

lisandropat avatar Jul 27 '21 17:07 lisandropat