I thought of a way. Maybe you can try to achieve it like this:
When isFetch is true, use a global element (DIV) mask, set the width and height to 100%, and then set the background color to be transparent, set the z-index to be greater than the element in the current interface, otherwise, the z-index is smaller than the element in the current interface. Then listen to the click event of this element. In this way, click events on the interface can be blocked. When isFetching is false, make the mask disappear.
In your React component,
handleClick = (e) => {
e.preventDefault();
e.stopPropagation();
}
.mask {
position: fixed;
width: 100%;
height: 100%;
background-color: transparent;
z-index: 1000;
}
.mask.disappear {
display: none;
}
<div>
your element
</div>
<div className={`mask ${isFetching ? '' : 'disappear'}`} onClick=
{this.handleClick}></div>