title: Undefined is not an object animated.interpolate react native
body: <p>I am looking at how to animate colors in react native and followed this tutorial <a href="https://codedaily.io/screencasts/8/Animate-Colors-with-React-Native-Interpolate" rel="nofollow noreferrer">https://codedaily.io/screencasts/8/Animate-Colors-with-React-Native-Interpolate</a></p>
  
  <p>All I have done is first run <code>react-native init</code> then replace the code in my App.js with this</p>
  
  <pre><code>import { StyleSheet, View, Text, Animated } from 'react-native';
  import React, { Component } from 'react';
  
  export default class App extends Component {
  
  componentDidMount() {
    this.animatedValue = new Animated.Value(0);
  }
  
  componentDidMount() {
   Animated.timing(this.animatedValue, {
    toValue: 150,
    duration: 1500
  }).start();
  }
  
      render() {
      const interpolateColor = this.animatedValue.interpolate({
        inputRange: [0, 150],
        outputRange: ['rgb(0,0,0)', 'rga(51,250,170)']
      });
  
      const animatedStyle = {
        backgroundColor: interpolateColor
      }
      return (
        &lt;Animated.View style={[{ width: 50, height: 50 }, animatedStyle]} /&gt;
      );
  }
  }
  </code></pre>
  
  <p>And then run <code>react-native run-android</code></p>
  
  <p>And now I keep getting <code>TypeError:undefined is not an object(evaluating 'this.animatedValue.interpolate')</code> </p>