AuxStudio / react-native-simple-animators

A simple, versatile and reusable animating component
MIT License
4 stars 4 forks source link

Components should accept testID prop #24

Open shaunsaker opened 6 years ago

shaunsaker commented 6 years ago

testID is used to locate a view in end to end tests.

StaticAnimator and EventAnimator should accept testID as a prop.

A better approach would be to accept any View props and pass them along to the Animated.View. We could potentially do this by accessing the props we use a spread:

  render() {
    const { type, initialValue, finalValue, style, children, ...props } = this.props;

    // ...render calcs

    return (
      <Animated.View {...props} style={[style, animatedStyles]}>
        {children}
      </Animated.View>
    );
  }
}

Please also update the components' prop-types.

karans5004 commented 4 years ago

@shaunsaker : Pls describe the issue more, I'll work on it

shaunsaker commented 4 years ago

Fantastic @karans5004 , I've updated the description 👍