Skip to content
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

React Router v5.1.1 Link Breaks with React v15.6.2 #6954

Closed
macpham opened this issue Sep 30, 2019 · 2 comments
Closed

React Router v5.1.1 Link Breaks with React v15.6.2 #6954

macpham opened this issue Sep 30, 2019 · 2 comments

Comments

@macpham
Copy link

macpham commented Sep 30, 2019

Version

v5.1.1

Steps to reproduce

  1. Using react v15.6.2 and react-router v5.1.1
  2. Production build (minified) with webpack v2 and Uglify (not sure if pertinent to the issue but part of the setup I am using)
  3. Create a component that renders with:
<div>
  <Link to={`/watch=${someVar}`}>Direct Link{</Link>
</div>

Expected Behavior

No errors.

Actual Behavior

Console will show:

image

https://reactjs.org/docs/error-decoder.html/?invariant=119

Note, the problem doesn't seem to happen when we are doing a development build where nothing is minified. I am not sure exactly why that is the case. Our production build is targeting ES5.

This problem does not happen at all when we are on v5.0.1 which we have been using for months. As a work around we have pinned our RR back to this version but could you please look into this as we would like to stay in sync with your latest releases.

@StringEpsilon
Copy link
Contributor

StringEpsilon commented Sep 30, 2019

Could this be a follow-up error of the #6934 fix?

The 'minified react error #119' says:

addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).

https://reactjs.org/docs/error-decoder.html/?invariant=119

That smells pretty much like another ref error.

Edit - yeah, it seems like 5.1.1 didn't fix the above mentioned issue. Here's a sandbox:

https://codesandbox.io/s/a-simple-react-router-v4tutorial-89wli

@mjackson mjackson mentioned this issue Sep 30, 2019
23 tasks
@mjackson
Copy link
Member

This should be fixed in 5.1.2, released soon

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants