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.

`transition` doesn't work when slide is in subcomponent

See original GitHub issue

If I have a Deck like this:

    <Deck transition={['slide']} transitionDuration={500} theme={theme}>
        <Slide transition={['slide']}>
            <Heading size={1} fit lineHeight={1}>
                About Me
            </Heading>
        </Slide>
    </Deck>

it works fine, but if I extract the Slide into a separate component:

export class AboutMe extends React.Component {
    render() {
        return (
            <Slide transition={['slide']}>
                <Heading size={1} fit lineHeight={1}>
                    About Me
                </Heading>
            </Slide>
        );
    }
}

the transition stops working and the slide never… slides in. If I remove the transition, the slide appears in the correct place, but no animation.

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
ahfarmercommented, Mar 2, 2018

@kenwheeler

trying to find a good way to not have to recurse too far

Can’t you recurse until you hit a <Slide>? I’m new to Spectacle but it looks like these are the only components that ever exist within <Deck>:

  • Slide
  • SlideSet
  • Intermediate component that renders Slide components or other intermediate components

First thing I tried to do when I got the boilerplate was to put my slides into separate files and it was pretty frustrating.

4reactions
mAAdhaTTahcommented, Aug 9, 2017

Hacky workaround: convert the slide from a ES6 class component to a stateless function component and render it by calling the function, rather than passing the function around as a component:

    <Deck transition={['slide']} transitionDuration={500} theme={theme}>
        <Slide transition={['slide']}>
            <Heading size={1} fit lineHeight={1}>
                Meet
            </Heading>
            <Heading size={1} fit lineHeight={1}>
                <code>brookjs</code>
            </Heading>
            <Text textSize={'40px'}>
                A framework for building streaming web applications.
            </Text>
        </Slide>
        {AboutMe()} <--- here
    </Deck>
Read more comments on GitHub >

github_iconTop Results From Across the Web

MUI Slide Transition doesn't work with two Slide - Stack Overflow
I want the animation for each mui Slide to work when the button is clicked. But for some reason they don't want to...
Read more >
Animation | Jetpack Compose - Android Developers
This technique is useful for separating concerns among multiple subcomponents in a complex composable. The parent transition will be aware of all the...
Read more >
Enter/Leave & List Transitions - Vue.js
Vue provides a variety of ways to apply transition effects when items are inserted, updated, or removed from the DOM. This includes tools...
Read more >
Part 15 - Contracting by Negotiation | Acquisition.GOV
(1) When the program is to be incorporated in the contract and the design status of the product being acquired does not permit...
Read more >
IRC 965 Transition Tax Overview - IRS
Primary UIL Code 9414.07-00 Section 965 Transition Tax ... the budget for fiscal year 2018,” P.L. 115-97 (Tax Cuts and Jobs Act [“TCJA”])....
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