react-native-progress-steps icon indicating copy to clipboard operation
react-native-progress-steps copied to clipboard

Dynamically create Progress Steps on the fly

Open fengshuifever opened this issue 3 years ago • 2 comments

Hi there, I've seen this question asked before in the Issues area but the solutions didn't seem to work for me. Code:

<ProgressSteps>
...earlier progressstep
{recipe.recipeInstructions.map(function(name, index){
                        return (
                            <ProgressStep>
                                <View>
                                    <Text>Test Method {name}</Text>
                                </View>
                            </ProgressStep>
                        )
                    })}
</ProgressSteps>

What I'm trying to do above is generate a ProgressStep for every recipe instruction that exists in that array. Unfortunately as soon as I try this, an error throws with undefined is not an object (evaluating '_this.props.children[i].props.label')

This seems to be coming from the ProgressSteps.js file at around line 38 (where the <StepIcon> is calling this.getChildProps().

Is there a way or an update coming to the package where we'll be able to dynamically create new ProgressStep components on the fly? I'm not quite sure how to progress with this. (I've also tried wrapping the ProgressStep tags with a Fragment but to no avail)

fengshuifever avatar Apr 05 '21 13:04 fengshuifever

Hi @fengshuifever Any solutions for this ?

RashVenkat6795 avatar May 31 '21 10:05 RashVenkat6795

@fengshuifever @RashVenkat6795 i had same issue couple of days ago. i think i have figured out solution, waiting for PR to get merged. #91

haseeb-numu avatar Jul 09 '21 21:07 haseeb-numu