score:0

There is a open method on your button onClick.You will get an event object in your useCallback method.You can use it to prevent both buttons triggering.You can use e.stopPropagation() method.

 const open = useCallback(async (event)=>{

 event.stopPropagation();

  const result = await = axios.post(
    Url,
    { source: 'data'},
    {
      headers: header,
    }
  );
  setData(result.data);
  }, [])

Related Query

More Query from same tag