Skip to content

Traversal direction from current state (outside events) #267

@GriffinSauce

Description

@GriffinSauce

Hi, so first off: this API rocks.

I'm looking into implementing transition animations for my app, which is powered by React Router.

For a "slide over" animation I'd need to know the direction of traversal. Now this is pretty easy to determine in the event handlers by comparing indexes but because my routing is handled by another library it would be very helpful to be able to access this information statically as well. (to avoid race conditions between the event handling)

So we have:

  • currentEntry provides information about the current state
  • entries() provides information about the entire stack
  • ... what's missing is the user behaviour, how they have traversed the stack, I could have 3 entries but actually a path of 10 back-and-forth actions. That is my actual navigation history.

I'm not sure if this steps too far outside of the scope of the API but I'd love to hear your opinions on this.

In terms of a solution, getting something like lastEntry would solve the problem, but perhaps a list of last visited entries (probably limited to reasonable number) could support more use cases.

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