Skip to content
This repository was archived by the owner on May 20, 2021. It is now read-only.
This repository was archived by the owner on May 20, 2021. It is now read-only.

Option to disable setting the url and adding to the history (e.g. for modals) #37

Open

Description

@robclouth

It would be super handy to be able to disable adding to the history and setting the url for certain routes, for example dialogs and modals.

Activity

  1. robclouth commented on Jul 14, 2019

    @robclouth
    Author

    For now I've moved all modals into a single router and return null for getPathAndParamsForState for the modal routes. This stops them getting added to the history and changing the url.

    const originalFunction = ModalStack.router.getPathAndParamsForState;
    (ModalStack.router as any).getPathAndParamsForState = (state: any) => {
      const currRoute = state.routes[state.index];
      if (currRoute.routeName === "MainSwitch") return originalFunction(state);
      else return null;
    };
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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