Skip to content

Compose link href from "to" property object with href, query and hash #1118

@marcelmokos

Description

@marcelmokos

Link element in ReactRouter comes with "to" property which can have href, query object and hash inside.

I prefer to build a query from an object instead of using string templates.

// desired api
// <Link to={{href?: string, query?: object, hash?: string}}>

// desired input
<Link to={{href: "home", query: {key: "value"}, hash: "hash"}}><a>text</a></Link> 

// desired output 
<a href="/home?key=value#hash">text</a>

Metadata

Metadata

Assignees

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