|
@@ -176,7 +176,7 @@ Navigation.dismissModal(this.props.componentId);
|
176
|
176
|
|
177
|
177
|
## Screen Lifecycle
|
178
|
178
|
|
179
|
|
-The `didAppear` and `didDisappear` functions are lifecycle callbacks that are called by React Native Navigation on the component when it appears and disappears.
|
|
179
|
+The `componentDidAppear` and `componentDidDisappear` functions are lifecycle callbacks that are called by React Native Navigation on the component when it appears and disappears.
|
180
|
180
|
|
181
|
181
|
These are similar to react's `componentDidMount` and `componentWillUnmount`, but are related to the actual visibility of a component to the user. While the component is `mounted` as soon as it's part of a layout, it is not always `visible` (for example, when another screen is `pushed` on top of it), and therefore React Native Navigation takes some performance optimizations.
|
182
|
182
|
|
|
@@ -195,12 +195,12 @@ class LifecycleScreenExample extends Component {
|
195
|
195
|
};
|
196
|
196
|
}
|
197
|
197
|
|
198
|
|
- didAppear() {
|
199
|
|
- this.setState({ text: 'didAppear' });
|
|
198
|
+ componentDidAppear() {
|
|
199
|
+ this.setState({ text: 'componentDidAppear' });
|
200
|
200
|
}
|
201
|
201
|
|
202
|
|
- didDisappear() {
|
203
|
|
- alert('didDisappear');
|
|
202
|
+ componentDidDisappear() {
|
|
203
|
+ alert('componentDidDisappear');
|
204
|
204
|
}
|
205
|
205
|
|
206
|
206
|
componentWillUnmount() {
|