Skip to content

LinkContainer requires pathname in 'to' object. Link does not. #299

Closed
@agawley

Description

@agawley

The following code will cause a runtime error:

<LinkContainer to={{ search: updateSortSearchParams('hi') }}>
    <Dropdown.Item>
       hi
    </Dropdown.Item>
</LinkContainer>

Whereas this will not

<LinkContainer to={{ path: '', search: updateSortSearchParams('hi') }}>
    <Dropdown.Item>
       hi
    </Dropdown.Item>
</LinkContainer>

This is not the same behaviour as <Link /> which happily accepts a search-only 'to' object

Seems like this code in LinkContainer.js should handle undefined pathname

var path = _typeof(to) === 'object' ? to.pathname : to;

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