Skip to content

pop(to:_) does not work #51

@Nathan1258

Description

@Nathan1258

For the given code:

struct View1: NavigatableView {
        var body: some View {
            VStack {
                Text("View1")
                Button(action: {
                    View2().push(with: .horizontalSlide)
                }) {
                    Text("Go to second view")
                }
            }
        }
    }

    struct View2: NavigatableView {
        var body: some View {
            VStack {
                Text("View2")
                Button(action: {
                    View3().push(with: .horizontalSlide)
                }) {
                    Text("Go to third view")
                }
            }
        }
    }

    struct View3: NavigatableView {
        var body: some View {
            Button(action: {
                pop(to: View1.self)
            }){
                Text("Go to View 1")
            }
        }
    }

pop(to:_) does not work. Sometimes it does not pop any view, sometimes it pops to the previous view as if I ran pop(). Steps to reproduce are above. Below is a demo of the code above:

ScreenRecording_07-21-2024.19-21-16_1.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions