79209326

Date: 2024-11-21 00:36:25
Score: 1
Natty:
Report link

You can work around it by wrapping everything in MainActor.assumeIsolated:

.onPreferenceChange(HeightKey.self) { height in
    MainActor.assumeIsolated {
        self.height = height
    }
 }

This should be fine as long as it's being called from the main thread.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Aloisius