Uh oh!
There was an error while loading. Please reload this page.
Fix Transition constants to match - #554
Conversation
silvenon
commented
Mar 27, 2020
Wow, thanks! Let's keep these constants attached for now, but they definitely need to go at some point. |
perrin4869
commented
Apr 27, 2020
@silvenon thanks for the merge, completely missed it hahaha |
silvenon
commented
Apr 27, 2020
After merging #559, which will be soon. 😉 |
jquense
commented
May 5, 2020
🎉 This PR is included in version 4.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
unrevised6419
commented
May 6, 2020
@silvenon you mean e.g. |
silvenon
commented
May 6, 2020
I guess, because these constants are already being exported, so this is a duplication. |
The problem is that they are not exported directly from https://github.com/reactjs/react-transition-group/compare/master...iamandrewluca:brent?expand=1 |
perrin4869
commented
May 6, 2020
Hm... Would still need to figure out why the |
unrevised6419
commented
May 6, 2020
@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' |
perrin4869
commented
May 6, 2020
@iamandrewluca hm... with your change, I think classTest{staticgetprop(){return"val1";}}console.log(Test.prop);// val1Test.prop="val2";console.log(Test.prop);// still val1
|
perrin4869
commented
May 6, 2020
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-bootstrapand traced the root cause back here.react-bootstrapis 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.jsin 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