react-native-animatable icon indicating copy to clipboard operation
react-native-animatable copied to clipboard

Animation definitions must have at least two values

Open hallya opened this issue 4 years ago • 1 comments

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])
    );
  });
}

hallya avatar Aug 10 '20 15:08 hallya

@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)
      );
    }
  });
}

christo8989 avatar Feb 03 '23 19:02 christo8989