Skip to content

Can't keep a screen mounted #808

Open
@florian-milky

Description

@florian-milky

Current Behavior

From the docs:

navigation.navigate({ name: SCREEN, key: SCREEN_KEY_A });
navigation.navigate({ name: SCREEN, key: SCREEN_KEY_B });
navigation.navigate({ name: SCREEN, key: SCREEN_KEY_C });
navigation.navigate({ name: SCREEN, key: SCREEN_KEY_D });

then

navigation.navigate({ key: SCREEN_KEY_A }); // will go to screen A FROM screen D

It will unmount B, C and D. (btw I think this should be highlighted more in the docs)
What if I want to keep let's say D mounted? And when I navigate to D again, I want to reuse the same instance.

My use case is a webview that I want to keep mounted in the background.
I found an old question in stackoverflow, never answered https://stackoverflow.com/questions/41818857/keep-react-native-webview-mounted

Expected Behavior

  • I want to have the option to keep a screen mounted and reuse the same instance when I navigate back to it.

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