gatsby-using-page-transitions
gatsby-using-page-transitions copied to clipboard
Variant Exit not working.
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?
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.