-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
selectorFactory: pass ownProps to areStatesEqual #1947
Conversation
Note, I'm also willing to make the corresponding changes in the v7 and master branches |
Our general stance on Generally we want people to use the hooks as they work much better with TypeScript and are a lot more straightforward to teach, write and read. Back in 2020, when #781 was last discussed, that wasn't as clear as today yet. |
So the approach before was "We don't know if we want to add the functionality, push it off" to "Hmm, we've gotten multiple requests for this, it seems reasonable to add especially considering the straightforwardness of the change" to "We pushed it off long enough that now it's considered legacy and we don't want to allow the change"? That doesn't sound great. While I agree that migrating to the hooks approach is the better long-term strategy, making that transition might require a substantial amount of work and enabling the functionality this PR brings helps bridge the gap. |
I see it this way, the other maintainers might chime in with different opinions: If you need this feature now, the code using Also, the whole situation of "I have a class component and now want to add connect" is very questionable. It's more likely that you had a class component with connect for a long time, working without this feature - or that you are writing a new class component right now, which you really should avoid if you want it to work well with modern React features (and modern libraries) going to the future. Writing new code with |
One point of order: This is targetting v5, which was last released almost 3 years ago. I'd rather not touch something that old. This should probably target v7 instead. I would say that we should add this in. I agree that it may not be best for greenfield code to use |
The assumption that
may not be correct (and is not correct in my case). We have many connected components and when investigating application performance, it was determined that |
Is there any opposition to adding this to v5 for backwards compat reasons? |
Please at least update your stack if you want new features. 🙁 There's even a good chance that you won't be facing your current performance problems with an up-to-date stack. |
I'm willing to look at this for v7 and v8. But we're no longer actively maintaining v5 and v6 at this point, and if for some reason your app is still on v5, I would strongly urge you to upgrade to v7 immediately. The public API is the same (with just a minor change to how the That said, I'm also very curious to know more about the perf issues you're dealing with - any chance you could record a Chrome JS perf capture of these issues, zip the JSON, and either attach it to an issue or send it to us via Discord? |
OK, closing this one out. |
This PR adds the ability for consumers to have access to
ownProps
inside ofareStatesEqual
.Currently there is no way to
See: #781