Skip to content

@Environment(\.dismiss) no longer works when using 0.3.5 #68

@rhysm94

Description

@rhysm94

Hi there!

Sorry, don't currently have a shareable reproduction case, but the change made in 0.3.5 seems to have broken the SwiftUI native @Environment(\.dismiss) action. The view that's presented by a TCARouter does not actually dismiss correctly. In my TCA state, nothing changes either when I press a button that calls the Environment's dismiss in a view.

I'm using TCACoordinators, but the issue doesn't appear to be specifically with TCACoordinators – if I pin my app to FlowStacks 0.3.4, everything works great. If I pin to 0.3.5, it breaks and @Environment(\.dismiss) stops working.

The issue affects both iOS 16 and iOS 17 – I've tried it on both iOS 16.4 and iOS 17.0.1/17.2 sims, and the issue persists. Given the only other non-iOS 17 change that exists is wrapping a screenView in a ZStack, I wonder if that's the particular issue I'm encountering. I'm just wondering if the screenView needs the whole @Environment propagating to it perhaps? I dunno, I'll give that a try and PR if it fixes things!

I'll try and get a reproduction case up soon as well, but I thought I'd better report the issue sooner!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions