How to like a post/image using react query ? #6844
              
                
                  
                  
                    Answered
                  
                  by
                    firaki12345-cmd
                  
              
          
                  
                    
                      firaki12345-cmd
                    
                  
                
                  asked this question in
                Q&A
              
            -
| So I am using react query to get the first 6 images and then when I scroll down.. the next apear and so on.. Now everything works fine.. and each post has a different image and like button.. But as soon as I click the like button the other 6 images also get liked... Why is that.. I am using UseState to set the button to liked or not liked. my CODE below Below are the images when liked and not liked Not liked: https://i.postimg.cc/HxtJjCwN/1.png liked: https://i.postimg.cc/BvHP9FX4/2.png Please,Help Thanks | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            firaki12345-cmd
          
      
      
        Feb 6, 2024 
      
    
    Replies: 1 comment
-
| SOLVED IT WITH THE CODE BELOW  | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        firaki12345-cmd
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
SOLVED IT WITH THE CODE BELOW