Barba: Transition `appear` hook is fired on each page even with a custom rule

Created on 18 Sep 2019  路  1Comment  路  Source: barbajs/barba

Hi @thierrymichel,

As discussed this morning, here is a fresh bug found in @barba/core. It seems that the appear transition hook is called on every browser reload, even if there is a custom from/to rule that target a specific namespace/route.

import barba from '@barba/core';

barba.init({
  transitions: [{
     name: 'fade',
     enter: fadeIn,
     leave: fadeOut
  }, {
    name: 'slider-leave',
    from: {
      namespace: ['index']
    },
    enter: slideIn,
    leave: slideOut
  }, {
    name: 'slider-enter',
    to: {
      namespace: ['index']
    },
    appear: slideIn, // this hook is fired on every browser reload, even on other namespace
    enter: slideIn,
    leave: slideOut
  }]
});

Here is the debug console log when the transition is fired:

[@barba/core]  Transition found [appear]
{name: "slider-enter", to: {鈥, appear: 茠, enter: 茠, leave: 茠}

I am using the latest @barba/[email protected] :v:

@barbcore bug hacktoberfest

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ershad989 picture ershad989  路  4Comments

oguilleux picture oguilleux  路  3Comments

pburdylo picture pburdylo  路  3Comments

shanewmurphy picture shanewmurphy  路  3Comments

Mexikaner9 picture Mexikaner9  路  3Comments