Skip to content

UserProfileView: Support embedding in an existing NavigationStack (avoid nested NavigationStack) #342

@matthew-dubois

Description

@matthew-dubois

Description

UserProfileView unconditionally wraps its content in a NavigationStack (line 141 of UserProfileView.swift). This means it cannot be pushed onto an existing NavigationStack via NavigationLink without creating nested NavigationStacks, which causes broken/missing transition animations for internal navigation (e.g., tapping Profile or Security).

Current behavior

When UserProfileView is pushed via NavigationLink from a parent NavigationStack, sub-page navigation (Profile, Security) has no transition animation — the destination view appears instantly without sliding in.

Expected behavior

UserProfileView should work correctly when pushed onto an existing navigation stack, with proper transition animations for internal navigation.

Suggested solution

Add an option to opt out of the internal NavigationStack, for example:

public init(isDismissable: Bool = true, wrapsInNavigationStack: Bool = true)

When wrapsInNavigationStack is false, the view would use the parent's NavigationStack and register its destinations via .navigationDestination(for:) instead of creating its own.

Workaround

Present UserProfileView in a .sheet instead of pushing via NavigationLink, so the internal NavigationStack is the only one.

Environment

  • clerk-ios (Swift SDK)
  • iOS 17+/SwiftUI

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions