always exclude header height when href is on the same page react code example
Example 1: offset anchor tag when scrolling
a.anchor {
display: block;
position: relative;
top: -250px;
visibility: hidden;
}
Example 2: offset anchor tag when scrolling
<a class="anchor" id="top"></a>