title: create like button using react native and firebase
body: <p>I'm beginner in react-native and I'm actually developing a event application in React-Native , i'm trying to create a like/dislike button . that's my code but not work</p>
  
  <pre><code>  const [likes,setLikes] = useState('');
  const [liked,setLiked] = useState(false);
  
  
  const eventInfo = ()=&gt;{
      const getInfo = firebase.database().ref('/users/event/' +postKey)
      getInfo.on('value', snapshot =&gt; {
          console.log('User data: ', snapshot.val())
          setLikes(snapshot.val().likes)
         // setIntersted(snapshot.val().interested)
         // setInterestedNmb(snapshot.val().interestedNmb)
         // setInterestedName(snapshot.val().interestedName)
          setLiked(snapshot.val().liked)
        });
  }
  
  const like = () =&gt; {
      const updateLike = firebase.database().ref('/users/event/' +postKey)
      updateLike.update({
          likes: likes +1 ,
          liked: true
      })
    };
  
    const dislike = () =&gt; {
      const updateLike = firebase.database().ref('/users/event/' +postKey)
      updateLike.update({
          likes: likes -1 ,
          liked: false
      })
    };
  </code></pre>
  
  <p>the problem is when i press <code>&lt;TouchableOpacity onPress={()=&gt; like() /&gt;</code>  by one user . like transform to true in all users . i want to create a list if a user press like . the user id added to the list . and if the user id is in the list like is true . if the user id isn't in the list . like is false 
  give me a solve please
  Thanks in advance!</p>