79274958

Date: 2024-12-12 11:43:28
Score: 5.5
Natty:
Report link

Can't you just add a @MainActor annotation to the block?

.onPreferenceChange(HeightKey.self) { @MainActor height in
  self.height = height
}
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • User mentioned (1): @MainActor
  • Starts with a question (0.5): Can't you
  • Looks like a comment (1):
  • Low reputation (0.5):
Posted by: Miguel Cabeça