Building custom solutions that extend, automate, and integrate Microsoft 365 apps.
I had a similar problem with the task pane. I worked around it by setting the margins of the background to a negative number. In my case, -8. Try something like that.
minHeight: "100vh",
minWidth: "100vw",
// The next five lines are to counteract the fact that Office adds
// a margin of 8 px just inside the margins of the task pane.
// This area is always white, even when the Office theme is dark.
// It looks bad. So we have to add a background color and
// extend the add-in page's margins out to cover the area
// with negative margin values.
backgroundColor: tokens.colorNeutralStrokeOnBrand,
marginTop: "-8px",
marginLeft: "-8px",
marginBottom: "-8px",
marginRight: "-8px",