jcmcneal / react-step-wizard

A modern flexible step wizard component built for React.
MIT License
583 stars 126 forks source link

Cannot read property 'hashKey' of undefined #42

Open LukasDeco opened 5 years ago

LukasDeco commented 5 years ago

I am trying to render steps form a loop. Here is my code:

<StepWizard isLazyMount={true} nav={<WizardDots />}>
          <Introduction />
          <CreateProfileInstructions giftTypes={state.giftTypes} onConfirmation={this.setGiftSelectionMode}/>
            {state.pages.map((type) => (
              <ProfileSelection key={type} hashKey={type} giftType={type} />
            ))}
        </StepWizard>

I am getting this error about cannot read property hashkey of undefined. I have tried initializing state.pages as both an empty array and an array with a single string element. How can I render steps based on an array in state?

Thanks!

janakact commented 5 years ago

I get the same error

dbmanny18 commented 3 years ago

I'm not sure what you're doing in ProfileSelection...but it seems as though in any child component of step wizard, any prop you pass in will be overridden by the parent props which are the props of StepWizard (nextStep, currentStep, etc..)