Skip to content

[Bug]: generatePath don't distinguish between absolute '/*' and relative '*' #8883

Closed
@SentretC

Description

@SentretC

What version of React Router are you using?

6.3.0

Steps to Reproduce

// Both produce '/index'
generatePath('*', {'*': 'index'})
generatePath('/*', {'*': 'index'})

while the other kind of placeholder

// Produces 'index'
generatePath(':param', {param: 'index'})
// Produces '/index'
generatePath('/:param', {param: 'index'})

also

// Both produce ''
generatePath('*')
generatePath('/*')

Expected Behavior

// Produces 'index'
generatePath('*', {'*': 'index'})
// Produces '/index'
generatePath('/*', {'*': 'index'})
// Produces ''
generatePath('*')
// Produces '/'
generatePath('/*')

Actual Behavior

(See the 'Steps to Reproduce' part)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions