I am building a progress bar which takes two inputs, totalSteps and activeStep. I am going to render a number of circles equal to the number of total steps, with the active step being grey.

I have experience mapping over an array of objects however in this case I don't have an array I am just given an integer.
I am attempting to write a function which returns a div in a for loop but this isn't working.
const ProgressBar = (props) => {
const { activeStep, totalSteps } = props;
const displayProgressBar = () => {
for (let i = 1; i <= totalSteps; i++) {
return <div>Hello</div>;
}
};
return <div className="progressBar">{displayProgressBar()}</div>;
};
The above code only renders Hello once even if totalSteps is 3. Is there a way to achieve the desired results without creating an array?
returnonce. If you want multiple elements in that return, you'll need to build up an array or some other data structure and return that.let arr = []; for (let i = 0; i < totalSteps; i++) arr.push(null);and then usemap