Also significant inflation = higher stock prices, while your principal would only decrease in value if you buy bonds.
Also it varies a lot by sector, consumer staples for instance have been doing quite well over the last year.
If you have double digits inflation and can’t/don’t want to buy foreign currency the stock market is probably the best place to be. Just look at Turkey: