Skip to content

Use Link outside of a router #4088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

pshrmn
Copy link
Contributor

@pshrmn pshrmn commented Oct 23, 2016

This should resolve #3889.

I added a note to the documentation listing the restrictions on this, which are:

  1. to must be a string. If to is an object, then the url will be /[object%20Object].
  2. If any active aware props are used, then a location prop must be included in the <Link>'s props.

@timdorr timdorr changed the title use Links outside of a router Use Link outside of a router Oct 23, 2016
@timdorr timdorr added this to the v4.0.0 milestone Oct 23, 2016
Copy link
Member

@timdorr timdorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ryanflorence
Copy link
Member

I'm actually considering not supporting all the location from props instead of context stuff. The idea was for redux support but I think ControlledRouter is better.

So, that leaves testing as the only use-case for rendering any of these components outside the context of a router. In v2 that was nice, but in v4 you can just wrap your unit test in a MemoryRouter and be done with it. So I'm going to be removing all the "prop instead of context"

@pshrmn pshrmn deleted the no-router-links branch October 26, 2016 19:54
@remix-run remix-run deleted a comment from florapdx Dec 29, 2017
@remix-run remix-run locked as resolved and limited conversation to collaborators Dec 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants