oblador / react-native-animatable

Standard set of easy to use animations and declarative transitions for React Native
MIT License
9.81k stars 702 forks source link

Animation definitions must have at least two values #325

Open hallya opened 4 years ago

hallya commented 4 years ago

I have this issue happening because of the way exports of definitions are managed.

it can be fixed this way :

registry.js

export function initializeRegistryWithDefinitions(definitions) {
  Object.keys(definitions).forEach(animationName => {
    const animation = typeof definitions[animationName] === 'function'
      ? definitions[animationName]()
      : definitions[animationName];
    registerAnimation(
      animationName,
      createAnimation(definitions[animationName])
    );
  });
}
christo8989 commented 1 year ago

@hallya I think there might be a typo.

Also, what I need is a little bit different. I think it's from bringing in redux toolkit but I'm not certain.

node_modules/react-native-animatable/registry.js

export function initializeRegistryWithDefinitions(definitions) {
  Object.keys(definitions).forEach(animationName => {
    if (animationName !== '__esModule') {
      const animationDefinition = typeof definitions[animationName] === 'function'
        ? definitions[animationName]()
        : definitions[animationName];
      registerAnimation(
        animationName,
        createAnimation(animationDefinition)
      );
    }
  });
}