Skip to content

Commit 767eee0

Browse files
committed
Revert "Add onStop parameter to this.props.start()"
This reverts commit fc9c24a.
1 parent 3c30332 commit 767eee0

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,7 @@ class HomeScreen {
176176
```
177177

178178
### Triggering the tutorial
179-
Use `this.props.start(fromStep, onStop)` in the root component in order to trigger the tutorial. You can either invoke it with a touch event or in `componentDidMount`. Note that the component and all its descendants must be mounted before starting the tutorial since the `CopilotStep`s need to be registered first.
180-
181-
The `onStop` method will be called after a user selects 'Skip' or 'Finish' buttion in the tooltip.
179+
Use `this.props.start()` in the root component in order to trigger the tutorial. You can either invoke it with a touch event or in `componentDidMount`. Note that the component and all its descendants must be mounted before starting the tutorial since the `CopilotStep`s need to be registered first.
182180

183181
### Listening to the events
184182
Along with `this.props.start()`, `copilot` HOC passes `copilotEvents` function to the component to help you with tracking of tutorial progress. It utilizes [mitt](https://github.com/developit/mitt) under the hood, you can see how full API there.

src/hocs/copilot.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ const copilot = ({
8787
});
8888

8989
startTries = 0;
90-
onStop = null;
9190

9291
mounted = false;
9392

@@ -125,7 +124,7 @@ const copilot = ({
125124
await this.setCurrentStep(this.getPrevStep());
126125
}
127126

128-
start = async (fromStep?: string, onStop?: () => void): void => {
127+
start = async (fromStep?: string): void => {
129128
const { steps } = this.state;
130129

131130
const currentStep = fromStep
@@ -147,17 +146,11 @@ const copilot = ({
147146
await this.setVisibility(true);
148147
this.startTries = 0;
149148
}
150-
151-
this.onStop = onStop;
152149
}
153150

154151
stop = async (): void => {
155152
await this.setVisibility(false);
156153
this.eventEmitter.emit('stop');
157-
158-
if (this.onStop != null) {
159-
this.onStop();
160-
}
161154
}
162155

163156
async moveToCurrentStep(): void {

0 commit comments

Comments
 (0)