Not necessarily, but most inverters (in Europe, at least) aren't designed to function without a grid anyway.
Some models of inverter brands like Victron (which isn't very common outside its niche of self-sufficiency because they are rather expensive and sometimes complex) can form a micro-grid. They have the option of a special circuit breaker [1] that decouples the inverter from the grid if the grid is detected to be down, which allows their use during a power outage.