-
Notifications
You must be signed in to change notification settings - Fork 651
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
Fix Transition constants to match #554
Conversation
Wow, thanks! Let's keep these constants attached for now, but they definitely need to go at some point. |
@silvenon thanks for the merge, completely missed it hahaha |
After merging #559, which will be soon. 😉 |
🎉 This PR is included in version 4.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@silvenon you mean e.g. |
I guess, because these constants are already being exported, so this is a duplication. |
The problem is that they are not exported directly from |
Hm... Would still need to figure out why the |
@perrin4869 Because they are not exported from Not recommended, this is not public API import { ENTERING } from 'react-transition-group/Transition' Recommended (but not exported right now) import { ENTERING } from 'react-transition-group' |
@iamandrewluca hm... with your change, I think class Test {
static get prop() {
return "val1";
}
}
console.log(Test.prop); // val1
Test.prop = "val2";
console.log(Test.prop); // still val1
|
This may really be a |
@perrin4869 I don't understand what you want to say exactly. Also as I see on library build, |
Now that I have time to see what this is about, what specific bug in react-bootstrap did you run into?
I think it is using the exported ones, e.g. I don't see a reason for making these constants a part of public API, I just wanted to delete the attached constants because they give the impression that they are indeed public, but that's a wrong way to expose them, if we wanted to do that. But I don't think there's point in overthinking this, we're probably going to rewrite the component API altogether anyway. 🤷♂️ |
Ran into a bug while using
react-bootstrap
and traced the root cause back here.react-bootstrap
is importing the different constants in their source code as follows:https://github.com/react-bootstrap/react-bootstrap/blob/d28b4f04acbb6910aac4417480f47f5503275791/src/Collapse.js#L7
However, their build ends up using the values defined in the bottom of
src/Transition.js
in this repo:Instead of the exported ones:
This PR makes the values match in order to fix the inconsistencies, and should not be a breaking change, since the features would work exactly the same as documented. Maybe the constants
Transition.UNMOUNTED
,Transition.EXITED
, etc, should be removed altogether though, since I am not sure they serve any purpose