title: How to have a heart beat animation with React native?
body: <p>I'm learning React native and I would like to have heart beat animation</p>
  
  <p>I did that but it's not the good result, I would like to have heart beat.</p>
  
  <p>If someone can help me it's would be very nice thanks a lot</p>
  
  <pre><code>import React, { PureComponent } from "react";
  import { Animated, StyleSheet, Text, View } from "react-native";
  
  export class Loading extends PureComponent {
    constructor(props: any) {
      super(props);
      this.state = {
        opacity: new Animated.Value(0),
      };
    }
    public componentDidMount() {
      Animated.timing(
        this.state.opacity,
        {
          toValue: 100,
          duration: 5000,
        },
      ).start(); 
    }
  
    public render() {
      return (
        &lt;View&gt;
          &lt;View&gt;
            &lt;Animated.View
          style={[styles.animation, {
          opacity: this.state.opacity,
          transform: [
          {
            scale: this.state.opacity.interpolate({ 
              inputRange: [0.5, 1],
              outputRange: [1, 0.95],
            }),
          }]},
          ]}
            /&gt;
          &lt;/View&gt;
        &lt;/View&gt;
      );
    }
  }
  
  const styles = StyleSheet.create({
    animation: {
      backgroundColor: "red,
      width: 100,
      height: 100,
      borderRadius: 50,
    },
  });
  </code></pre>