You could capture the state/binding and mutate the wrapped value, e.g.
.onPreferenceChange(SizeKey.self) { [$size] size in
$size.wrappedValue = size
}
Btw the thread title is misleading, onPreferenceChange was always nonisolated, what changed is the action closure becoming @Sendable.