使用StepZilla,我无法跳到其他步骤...我没有使用任何浏览器会话,这里我使用的是redux store。
import React from 'react';
import StepZilla from 'react-stepzilla';
import ThankyouStep from './ThankyouStep.js';
import Purchase from './PurchaseStep.js';
import Configure from './ConfigureStep.js';
import {connect} from 'react-redux'
import {selectMainWizardStep} from '../../Actions/WizardActions'
require('../../styles/css/Wizard.css');
class MainWizard extends React.Component {
render() {
const steps =
[
{ name: 'Purchase', component: <Purchase /> },
{ name: 'Configure', component: <Configure organizationId = "121334-11-0000000000000" /> },
{ name: 'Thank You', component: <ThankyouStep /> },
];
在成功购买标签填充之后,我想要跳转到配置选项卡。但那种跳跃并没有发生。在这里,我评论了两行,因为这是使用浏览器会话。使用浏览器会话我能够跳转到配置步骤。但是由于页面刷新,redux状态正在丢失。这就是为什么我使用redux存储,但我无法跳转配置页面。
return (
<article className='step-progress'>
<StepZilla
steps={steps}
preventEnterSubmission={true}
nextTextOnFinalActionStep={'Save'}
hocValidationAppliedTo={[3]}
//startAtStep={window.sessionStorage.getItem('step') ? parseFloat(window.sessionStorage.getItem('step')) : 0}
startAtStep = {this.props.Wizard.selectedWizradStep}
//onStepChange={(step) => window.sessionStorage.setItem('step', step)}
onStepChange = {(step) =>this.props.selectMainWizardStep(step)}
showNavigation={false}
/>
</article>
);
}
}
function mapStateToProps(state) {
return {
Wizard: state.Wizard
};
}
const mapDispatchToProps = {
selectMainWizardStep
};
export default connect(mapStateToProps, mapDispatchToProps)(MainWizard);