Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck with error when trying to dynamically create step numbers for the progress bar #23

Open
dsolowitz opened this issue Mar 11, 2020 · 1 comment

Comments

@dsolowitz
Copy link

dsolowitz commented Mar 11, 2020

Describe the bug
HERE is the error i'm catching in the console:
Uncaught TypeError: Cannot read property 'orientation' of undefined
Basically I have a component that has a dynamic amount of steps that is determined by the user. Im creating an array of numbers, mapping through said array and trying to renter them as step numbers in the progress bar.
Here is the code from app:

render() {
let pCent = (this.props.currentStep / this.props.totalSteps) *100
var steps = []
for(var i = 1; i < this.props.totalSteps ; i++) {
steps.push(i);
}
return (


<ProgressBar
percent={pCent}
//filledBackground="linear-gradient(to right, #fefb72, #f0bb31)"
>

{ steps.map((data, idx) => {
return
{idx + 1}

})}

      </ProgressBar>
  </div>
);

}
}

@dsolowitz
Copy link
Author

for some reason adding a code block is being weird here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant