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.

Hello. I faced with some problem. My first step is Select and for each selection value I have config file with steps, because I need to change set of steps when I change select value. So, my render looks like

 <StepWizard
          isHashEnabled
          isLazyMount
          onStepChange={this.onStepChange}
        >
          {this.renderSelect()}
          {steps.map(({ Component, key }) => (
            <Component key={key} hashKey={key} />
          ))}
        </StepWizard>

The problem is that StepWizard think that there are only two steps (Select and second), although config file (steps) contains list of steps. How I can solve it?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
luistakcommented, Feb 27, 2020

Hi there!

In my case, I solved this issue mapping a list of steps into an array than rendering this list inside the StepWizard

// Example component
...

  const dynamicSteps = dynamicStepsList.map((stepy) => (
    <CustomStep
      key={stepy.id}
      data={stepy}
    />
  ));

  const renderSteps = () => {
    return [
      <SomeIntroductionSteps key={`intro-${steps.title}`} />,
      ...dynamicSteps,
    ];
  }

  return (
      <StepWizard>
        {renderSteps()}
      </StepWizard>
  );
0reactions
resolrittercommented, Sep 5, 2020

This workaround should no longer be needed if #76 works out

Read more comments on GitHub >

github_iconTop Results From Across the Web

PixiJS: Render Loop
The first step is to calculate how much time has elapsed since the last frame, and then call the Application object's ticker callbacks...
Read more >
Iterating & Rendering with Loops in React components
Learn how to loop & output from arrays of data in React.
Read more >
Creating a simple render loop in a custom render pipeline
It demonstrates how a basic render loop works. It shows the clearest workflow, rather than the most efficient runtime performance.
Read more >
How to Implement a Component Loop in React
This guide demonstrates how to implement loops in common use cases, such as rendering a list of static data and outputting data from...
Read more >
Rendering Loop
In the render loop, we are going to use a single fence to wait until the GPU has finished executing the render work....
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