ContainerRelativeShape, but not in a Widget

Every example I've seen of ContainerRelativeShape uses it to match the outline of a view to the corner of a widget. I've tried that, it works well.

I cannot, however, figure out how to get it to function outside of a Widget, e.g. in a normal SwiftUI iOS app. The docs say:

"A shape that is replaced by an inset version of the current container shape. If no container shape was defined, is replaced by a rectangle."

I've tried everything I can think of to place a ContainerRelativeShape inside another nonrectangular view, with no luck. I assume that's because the outer view is not defined as "the current container shape", but I don't see any means to accomplish that.

Is ContainerRelativeShape only useful in the context of a Widget?

I’m wondering this as well 5 years later. HackingWithSwift says it only works in a widget, but HolySwift infers it can work anywhere, but I cannot get it to work.

https://www.hackingwithswift.com/quick-start/swiftui/when-should-you-use-containerrelativeshape https://holyswift.app/containerrelativeshape-swiftui-tutorial/

ContainerRelativeShape, but not in a Widget
 
 
Q