question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fade cannot fade components that don't pass down `style`

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Previous Behavior In version 1.0.0.beta31, you could put anything inside a <Fade> component and it would get faded.

Current Behavior As of version 1.0.0.beta32, it seems that Fade relies on the child component doing the right thing with the style prop.

Here’s a CodeSandbox example: https://codesandbox.io/s/7j8y2rqyn6

I am not sure if this is intended behavior or not, but the change caught me off guard and I figured I should mention it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
AdamGorkozcommented, Feb 16, 2018

@oliviertassinari I would like to take this one if you don’t mind 😃

Since this is my first contribution (ever) i’d like to better understand the agreed upon solution here. So the Fade component should wrap what ever children it gets with a div automatically so the fade transition will work correct ? or are we saying that the user should be aware that he needs to add a single div as child and the docs will tell him that ?

And as for docs , how should this be documented ? if we are going with the first solution i don’t think it should appear in the API doc of this components since its internal .

1reaction
oliviertassinaricommented, Feb 13, 2018

@sebald Has already experienced this issue. The simplest solution is to add an extra <div> element as first children to receive the style property. This change was made in order to better support server rendering. I believe we need to document this point.

<Fade in={this.state.in}>
+ <div>
    <UnfadableDiv />
+ </div>
</Fade>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fade cannot fade components that don't pass down `style`
As of version 1.0.0.beta32, it seems that Fade relies on the child component doing the right thing with the style prop. ... I...
Read more >
MUI Fade component does not show, hide, or fade components
Based on the API here. I believe in set to true should cause the component to fade in. This worked for causing a...
Read more >
Fade API - Material UI - MUI
Name Type Default children * element addEndListener func appear bool true
Read more >
How to Add a CSS Fade-in Transition Animation to Text ...
A CSS fade transition is a stylistic effect in which an element — like an image, text, or background — gradually appears or...
Read more >
Fade in-out text in react. - Level Up Coding
This article shows how to create the fade in-out text effect in react. We make use of react components to create the fade...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found