-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
1.6.1 is breaking #2499
Comments
I know it's weird but have you tried wrapping MyComponent with the connect HOC before passing to like
Although this is just a workaround |
This looks like an issue with React Redux instead Check this tweet https://twitter.com/acemarke/status/1024761710765334528?s=21 ForwardRef does not work well with React Redux |
I can't do that. As I've said:
There are other ways but I won't be refactoring tons of components with workarounds for this. I'd rather wait for stuff to get fixed. @sibelius I am aware that Redux can't handle forwardRef. I am just saying that:
Relay 1.6.1 clearly violates SemVer and I see two options here:
|
1.6.0 was a breaking change as well, as it set the minimum React version to 16.4.x |
We fixed this in Facebook by forking react-redux and removed that invariant error. Hopefully it can be fixed upstream soon. cc @markerikson :) |
I don't think this is about connect using forwardRef. It's about our check for valid components being passed in, which is a separate open issue about our use of react-is. |
@markerikson Yeah sorry I wasn't making it clear. That's the exactly the issue I'm talking about. Tracker: reduxjs/react-redux#914. |
I'll try to push us to be more careful about bumping the version correctly, but keeping track of the breaking changes can sometimes be hard and slip through. One thing that made this worse is that we've had a long lag without any releases increasing the likelihood of something slipping through. We've done some internal improvements to make it easier to release and hopefully can do that just more regularly to keep the list of changes down to fewer commits. I don't think there's much left here as we can't revert to the old ref API as React.forwardRef allows us to move forward with the next improvements! |
@kassens yeah, more often releases will be a good thing for the community. One release in half of the year looks so like that the project is unmaintained well. Minimal one release per a month will be a good deal 😎 |
@nodkz agreed! Just finished a new RC https://github.com/facebook/relay/releases/tag/v1.7.0-rc.1 |
Rock it! Take care about OSS Relay package, who else if not you! |
FWIW the only change from 1.6.1 to 1.6.2 was a minor dependency update: |
I am aware that usage of
React.forwardRef
is listed under "Potentially Breaking" in the change log. It says:This is a breaking change for people relying on the relayContainer.refs.component implementation detail.
Sadly, there is more to it. Our app is completely broken, because we have cases like this:
After upgrading to 1.6.2, connect()s like this started throwing:
You must pass a component to the function returned by connect. Instead received {}
We do this because we need data from the Redux store that we use in query variables so we don't have the option to re-order
createPaginationContainer()
andconnect()
.I don't know if we are benefiting from internal usage of it, but other than that we really don't care about
React.forwardRef
, but we need other changes in 1.6.1.Official React documents also state that usage of
React.forwardRef
should bump major:https://reactjs.org/docs/forwarding-refs.html#note-for-component-library-maintainers
Could this be respected?
The text was updated successfully, but these errors were encountered: