A native view that JS renders by name with `Native.hostedView`. The view fills its element, padding included. Each axis the element's style leaves `auto` takes the view's `intrinsicContentSize`, which the host reads after every `update(_:)`. Call `EffectUIContext.invalidateSize()` when it changes a
| 20 | /// host reads after every `update(_:)`. Call `EffectUIContext.invalidateSize()` |
| 21 | /// when it changes at any other time. |
| 22 | @MainActor |
| 23 | public protocol EffectUIHostedView: EffectUIPlatformView { |
| 24 | /// Applies the props that changed, on the main thread. |
| 25 | /// |
| 26 | /// The first call has every prop the element sets. A removed prop arrives as |
| 27 | /// `NSNull`. A prop named `color` or ending in `Color` arrives as an |
| 28 | /// `NSColor` or `UIColor`, and the others as JSON values (`NSNumber`, |
| 29 | /// `NSString`, arrays and dictionaries). |
| 30 | func update(_ changed: [String: Any]) |
| 31 | |
| 32 | /// The view the element's React children mount in. Defaults to `nil`, |
| 33 | /// which draws them above the hosted view. |
| 34 | /// |
| 35 | /// It should hold only those children, as the host inserts each at its |
| 36 | /// index among the subviews. React lays them out from the element's |
| 37 | /// top-left corner, so the view should fill the hosted view. On macOS it |
| 38 | /// must be flipped (`isFlipped` returns `true`). |
| 39 | var contentView: EffectUIPlatformView? { get } |
| 40 | |
| 41 | /// Runs a command JS sends with `Native.Host`'s `command`, on the main |
| 42 | /// thread. `args` holds JSON values. Does nothing by default. |
| 43 | func command(_ name: String, _ args: [Any]) |
| 44 | } |
| 45 | |
| 46 | public extension EffectUIHostedView { |
| 47 | var contentView: EffectUIPlatformView? { |
no outgoing calls
no test coverage detected