JSFiddle - React, Tailwind, and code Playground

HTML

<script src="//platform.linkedin.com/in.js"></script>
<div id="scripts-go-here">

</div>

JavaScript

addScript = function(counterPosition) {
    mainElement = document.getElementById("scripts-go-here");
    d = document.createElement("script");
    d.type="IN/Share";
    d.setAttribute("type", "IN/Share");
    d.setAttribute("data-counter", counterPosition);

    // Reset the current element, since we only want to change the layout of the button
    while(mainElement.firstChild) {
        mainElement.removeChild(mainElement.firstChild);
    }
    mainElement.appendChild(d);
    IN.parse();
}

addScript("right");
setTimeout(
    function(){
        addScript("top")
    }, 2500);