Skip to content

Can I pass a rootNode to nanohref? #704

Open
@m90

Description

@m90

I am trying to mount a choo application in an "application shell" that is provided by a static site generator.

I would expect the routing behavior to be limited to the scope of choo's application host, yet nanohref will try to handle all anchors being clicked.

Looking at the nanohref docs, this behavior seems to be supported by passing a second rootNode argument to the nanohref function: https://github.com/choojs/nanohref#nanohrefhandlerlocation-rootnode

Looking at how choo itself is using nanohref it looks like passing a second argument is not intended: https://github.com/choojs/nanohref#nanohrefhandlerlocation-rootnode

This leads me to two questions:

  1. Is it possible to achieve this behavior in some other way?
  2. In case no, would you accept a PR that enables passing the application root to nanohref as well? In this case I have to admit I am slightly unsure how the API for this could even look like considering how there is basically zero surface area for options in choo.

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