Skip to content

LocationProvider type is missing url prop #41

@florianeckerstorfer

Description

@florianeckerstorfer

I'm trying to test a component that uses useLocation with @testing-library/preact and I found no information in the docs on how to mock the location. After looking through the source code I figured out I can just provide the URL to the LocationProvider:

render(
  <LocationProvider url="/some/path">
    <My Component />
  </LocationProvider>
);

However, since url is missing from the Typescript type I get an TypeError in my code. Is there a reason why the prop is missing from the type or should it be added?

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