JSFiddle - React, Tailwind, and code Playground

HTML

<div class="div-1">
    <div class="div-2">
        This is a modal window being centered.
    </div>
</div>

CSS

.div-1 {
    position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    z-index: 13;
}
.div-2 {
    margin: 0 auto;
    width: 400px;
    background: khaki;
}