Skip to content

Improve support for a variety of hrefs in the Link component #25

@webJose

Description

@webJose

Currently, the href property of the <Link> component is quite "delicate". For example, creating a link with query string parameters is not explicitly acocunted for, and will cause issues if preserving query string via the preserveQuery property.

Furthermore, it assumes no hash value is in it. For path routing, it should be possible to create a <Link> component whose href property carries a hash value.

Proposal

Enhance href calculation to account for all possible cases:

  • Just a path
  • A path with a hash value (only allowed for path routing <Link> components)
  • A path with a hash value and query string (only allowed for path routing <Link> components)
  • A hash value with query string (only allowed for path routing <Link> components)
  • A path with query string
  • Just a query string
  • Just a hash value (only allowed for path routing <Link> components)

For the cases where a query string is found in href, it should be appended to whatever query string currently exists if preserveQuery is true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions