Skip to content

Components should accept testID prop #24

Description

@shaunsaker

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions