Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upTransition is "appearing" by default and the documentation says that it is false as default #22162
Comments
|
I just noticed that here in the Material UI the material-ui/packages/material-ui/src/Fade/Fade.js Lines 107 to 109 in afa8a58 |
|
This problem seems to be another #11683 or #21924 more recently. We have a prop that is inherited from somewhere else, that we don't document, but yet, we change its default value. Displaying the props with its custom default prop as with the others could be our "best worse" option. Any better UX in mind? (without considerations for the implementation) @eps1lon What solution do you have in mind with? What will be the UX?
|
I'm never going to find it, but I do vaguely recall a discussion back when the transitions were added as to what would be the most sane default. @oliviertassinari is right though - it should be documented. |
The way this default is setup is different to any pattern we're currently using. diff --git a/packages/material-ui/src/Grow/Grow.js b/packages/material-ui/src/Grow/Grow.js
index 6ab04f846d..f3b01095c9 100644
--- a/packages/material-ui/src/Grow/Grow.js
+++ b/packages/material-ui/src/Grow/Grow.js
@@ -28,6 +28,7 @@ const styles = {
*/
const Grow = React.forwardRef(function Grow(props, ref) {
const {
+ appear = true,
children,
in: inProp,
onEnter,
@@ -154,7 +155,7 @@ const Grow = React.forwardRef(function Grow(props, ref) {
return (
<TransitionComponent
- appear
+ appear={appear}
in={inProp}
nodeRef={nodeRef}
onEnter={handleEnter}is the smallest possible change right now (+ Though I don't think we ever had this default documented. |
@eps1lon As far as I know, we never had it documented. Maybe we could have a new prop Hum, maybe not. I'm all |
I think we can make an argument the documenting |


Current Behavior馃槸
When using the component
Transition, the content "appears" instead of having the default behavior of not appearing on the first mount.Expected Behavior馃
The component should not appear on the first mount, as stated on the documentation.
Steps to Reproduce馃暪
Steps:
https://codesandbox.io/s/nice-hooks-fpi84?file=/src/Demo.js
Context馃敠
Your Environment馃寧