Skip to content

Transition issues with dynamic slide rendering (without breaking other apis) #467

Closed Answered by davidjerleke
remy90 asked this question in Help
Discussion options

You must be logged in to vote

Hi @remy90,

Assuming this is the requirement:

The next button should always be enabled when we know there's another question. Ideally, a loading screen is only displayed because of large data fetches or slow network requests, so the first option seems best IMO

I would do it like this:

  1. If I understand you correctly, you know the total number of slides in advance. So create empty slides for all questions when you declare your useState() for the slides:
interface QuestionType {
  hasLoaded: boolean
  isLoading: boolean
  questionDetails: {
    title: string
    // ...additional data on this model
  }
}

function emptyQuestionsFromNumber(questionCount: number): QuestionType[] {
  const qu…

Replies: 1 comment 16 replies

Comment options

You must be logged in to vote
16 replies
@davidjerleke
Comment options

@remy90
Comment options

@remy90
Comment options

@davidjerleke
Comment options

Answer selected by remy90
@davidjerleke
Comment options

@remy90
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants