Skip to content

Commit 049b2a8

Browse files
Wizard code clean up.
1 parent 79c9ece commit 049b2a8

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

src/modules/wizard/components/WizardPageContainer.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,31 @@ class WizardPageContainer extends React.Component {
2020
}
2121
}
2222

23-
transitionStateMachine(nextProps) {
24-
switch (nextProps.wizard.currentState) {
23+
transitionStateMachine({
24+
wizard,
25+
requiresInitialization,
26+
initialized,
27+
requiresValidation,
28+
canTransition,
29+
finishedDisposing
30+
} = {}) {
31+
switch (wizard.currentState) {
2532
case wizardStates.INITIALIZING: {
26-
if (!nextProps.requiresInitialization) {
27-
nextProps.initialized();
33+
if (!requiresInitialization) {
34+
initialized();
2835
}
2936
break;
3037
}
3138
case wizardStates.PAGE_INITIALIZED: {
32-
if (nextProps.requiresValidation) {
33-
nextProps.requiresValidation();
39+
if (requiresValidation) {
40+
requiresValidation();
3441
} else {
35-
nextProps.canTransition();
42+
canTransition();
3643
}
3744
break;
3845
}
3946
case wizardStates.DISPOSING: {
40-
nextProps.finishedDisposing();
47+
finishedDisposing();
4148
break;
4249
}
4350
default: {

src/screens/wizardExample/components/WizardExampleContainer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class WizardExampleContainer extends Component {
2727
prevProps.wizard.currentState !== wizardStates.DISPOSING &&
2828
this.props.wizard.currentState === wizardStates.DISPOSING
2929
) {
30-
// This is where you can clean up call back references, release
31-
// handles, etc...
30+
// This is where you can clean up call back references, release handles, etc...
3231
alert("Wizard is disposing, clean up here...");
3332
}
3433

0 commit comments

Comments
 (0)