Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color Interpolation for borderColor causes InvalidProp error #8233

Closed
calclavia opened this issue Jun 20, 2016 · 1 comment
Closed

Color Interpolation for borderColor causes InvalidProp error #8233

calclavia opened this issue Jun 20, 2016 · 1 comment
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@calclavia
Copy link

calclavia commented Jun 20, 2016

I have a circle view in which I want to animate the color of the border using a Animated.Value that changes between 0 and 1. Following the guide from https://facebook.github.io/react-native/docs/animated.html I ended up using the interpolate function in Animated.Value.

     borderColor: this.state.active.interpolate({
        inputRange: [0, 1],
        outputRange: ['rgba(0, 0, 0, 0)', 'rgba(0, 0, 0, 1)']
      })

This creates a warning in the app (Android):

index.android.bundle:29278Warning: Failed propType: Invalid prop `borderColor` supplied to `View`: [object Object]
Valid color formats are
  - '#f0f' (#rgb)
  - '#f0fc' (#rgba)
  - '#ff00ff' (#rrggbb)
  - '#ff00ff00' (#rrggbbaa)
  - 'rgb(255, 255, 255)'
  - 'rgba(255, 255, 255, 1.0)'
  - 'hsl(360, 100%, 100%)'
  - 'hsla(360, 100%, 100%, 1.0)'
  - 'transparent'
  - 'red'
  - 0xff00ff00 (0xrrggbbaa)

Bad object: {
  "borderWidth": 2,
  "justifyContent": "center",
  "alignItems": "center",
  "width": 200,
  "height": 200,
  "borderRadius": 100,
  "borderColor": "rgba(0, 0, 0, 0)"
} Check the render method of `Circle`.

From the warning above, it seems like borderColor is correct. However, it still gave the warning.

@calclavia
Copy link
Author

calclavia commented Jun 20, 2016

Fixed it by using <Animated.View> instead of <View>

@facebook facebook locked as resolved and limited conversation to collaborators Jun 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants