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.

Confusion around hasSlideChildren doc

See original GitHub issue

I’ve been fighting with this for a bit, and even debugging through the code, I’m a little confused as to how hasSlideChildren is supposed to work.

It looks from the code, as well as the doc, that if an element has hasSlideChildren set, it will look at that element’s children. That works well enough if I do something like (though it kinds of defeat the purpose):

      <Deck
        transition={['zoom', 'slide']}
        transitionDuration={500}
        theme={theme}
      >
        <MySlides hasSlideChildren>
          <Slide>1</Slide>
          <Slide>2</Slide>
        </MySlides>
      </Deck>

But if I make a MySlides components that return the 2 slides, and put hasSlideChildren as per the doc:

class MySlides extends Component {
  render() {
    return (
      <div hasSlideChildren>
        <Slide>1</Slide>
         <Slide>2</Slide>
      </div>
    )
  }
}

And then, in my Presentation component, I import MySlides and use it as a child of Deck, there’s two issues:

First, if using a div, React will complain that I’m using a non-supported property. Easily fixed by using the SlideSet component that I found looking through the code.

Second and more importantly: the hasSlideChildren prop is now on a child of MySlides, and Spectacles will never see it.

So I’m a bit confused: did I just completely misunderstand how it’s meant to be used?

Issue Analytics

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

github_iconTop GitHub Comments

5reactions
Phoenixmatrixcommented, Jan 9, 2018

ok, if I have a module that exports (notice this is not a component, just a bunch of JSX):

export default (
   <SlideSet>
       <Slide>1</Slide>
       <Slide>2</Slide>
   </SlideSet>
)

and then I consume this, eg:

import Foo from './foo'

/* lower down*/
render() {
   return   (<Deck
     transition={['zoom', 'slide']}
     transitionDuration={500}
     theme={theme}
      >
        {Intro}
    </Deck>
  );
}

That works. But somehow I expect that’s not the intended usage. (Its good enough to unblock me for now though)

1reaction
ebrillhartcommented, Nov 14, 2018

Hey everyone, this issue is related to a known bug that we’re in the process of fixing! Just wanted to give an update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Confusion Information | Mount Sinai - New York
The doctor will do a physical examination and ask questions about the confusion. The doctor will ask questions to learn if the person...
Read more >
Sudden confusion (delirium) | nidirect
Sudden confusion (delirium) describes a state of sudden confusion and changes in a person's behaviour and alertness. If the confusion has come on...
Read more >
Sudden confusion (delirium) - NHS
Sudden confusion (delirium) can have many different causes. Get medical help immediately if someone suddenly becomes confused (delirious).
Read more >
Confusion around hasSlideChildren doc - GitAnswer
I've been fighting with this for a bit, and even debugging through the code, I'm a little confused as to how hasSlideChildren is...
Read more >
Confusion: Causes, Treatment & When to Seek Help - Healthline
Confusion is a symptom that makes you feel as if you can't think clearly. Learn more about the possible causes and how to...
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