Open mysterybear opened 4 years ago
Hey @mysterybear ! The reason for this was actually a poor API design decision I made originally. Essentially this is because the transition state/status is passed to each page as props. Since those props keep changing it keeps re-rendering the page. Since removing this would be a breaking change I added an option to disable it. See https://github.com/TylerBarnes/gatsby-plugin-transition-link/pull/149 for the change. You should be able to use it like so:
{
resolve: 'gatsby-plugin-transition-link',
options: {
injectPageProps: false,
},
},
You wont be able to get transition info from page component props anymore with that setting disabled. I'm not sure if this affects any of the AniLink components (haven't checked yet). In V2 injectPageProps: false
will become the default to avoid the negative performance impact this can cause.
Hi,
Howcome this plugin causes this behaviour?
Code for this is a minimal diff on gatsby-starter-default just adding this plugin and swapping out Gatsby's
Link
s with this plugin's, and then addingconsole.log
's to the components' render blocks. Here: https://github.com/mysterybear/issue-demo-transition-link-renders