Bläddra i källkod

update the docs for screen lifecycle methods (#2953)

Jonny 6 år sedan
förälder
incheckning
e8c8d683f0
2 ändrade filer med 6 tillägg och 6 borttagningar
  1. 1
    1
      docs/README.md
  2. 5
    5
      docs/docs/Usage.md

+ 1
- 1
docs/README.md Visa fil

@@ -13,7 +13,7 @@ We are rebuilding react-native-navigation.
13 13
 - [v2 Roadmap](#v2-roadmap)
14 14
 - [v1 vs v2 feature comparison](#v1-vs-v2-feature-comparison)
15 15
 - [Documentation](https://wix.github.io/react-native-navigation/v2/)
16
-- [Contributing](/docs/WorkingLocally.md)
16
+- [Contributing](/docs/docs/WorkingLocally.md)
17 17
 
18 18
 ## Why Rebuild react-native-navigation?
19 19
 

+ 5
- 5
docs/docs/Usage.md Visa fil

@@ -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() {