Closed stephencelis closed 3 weeks ago
What would be the proper way to do something like this in newer versions of TCA? I'm seeing the 'subscript(dynamicMember:)' is deprecated
warning:
guard let row = state.$presentedData[id: itemId] else { return .none }
@acosmicflamingo The warning should give a hint. Is it not helpful?
You can use Shared.init
to explicitly unwrap an optional shared, just like Binding.init
.
This makes the default work as expected, avoiding the issue brought up in #3169.
Technically this breaks the following invocation:
And limits the warning to:
We consider this lookup to be a bug, though, which is already deprecated in 1.11.0.
Since we encourage folks to migrate by one minor version at a time, we should only merge this when we plan on releasing 1.12.0.