How can you pass the id on each clickso that it detects the specific post?

Iโ€™m trying to pass the id of the elements clicked in here, so when the button is clicked it should detect the id of the element clicked and then pass it to the onclick function:

  { => {
    if(user.get("username") === {
        return <div class="central-meta item" key={}>
        <div class="pit-post">
                <img src="images/resources/red-post2.jpg" alt="" />
                <i class="fa fa-video"></i>
            <div class="pit-post-deta">
                <h4><a href="social-post-detail.html" title="">{result.title}</a></h4>
                <ul class="post-up-time">
                        <div class="usr-fig">
                            <img src="images/resources/comet-1.jpg" alt="" />
                            <a href="#" title="">p/{user.get("username")}</a>
                    <li><i class="fa fa-clock-o"></i> Jan 12, 2020</li>
                        <div class="smiles-bunch">
                            <i class="em em---1"></i>
                            <i class="em em-smiley"></i>
                            <i class="em em-anguished"></i>
                            <i class="em em-laughing"></i>
                            <i class="em em-angry"></i>
                            <i class="em em-astonished"></i>
                            <i class="em em-blush"></i>
                            <i class="em em-disappointed"></i>
                            <i class="em em-worried"></i>
                            <i class="em em-kissing_heart"></i>
                            <i class="em em-rage"></i>
                            <i class="em em-stuck_out_tongue"></i>
            <div class="number">
                <span class="plus" key={} onClick={(id) => addVotes(id)}><i class="fa fa-angle-up"></i></span>                                                     
                <input type="text" value="0"/>
                <span class="minus" onClick={() => decreaseVotes()}><i class="fa fa-angle-down"></i></span>
    } else {

Here is the onclick function, with this, the data which is the place where I store the database should detect the id, but this doesnโ€™t work properly:

const addVotes = (id) => {
    data[id].set("votes", votes+1)

    return data;