Add dismiss helper, made possible by also adding carefullyGetParent (#3669)

* Add dismiss action, made possible by getParentState

* Add dismiss to flow interface

* Don't dispatch an action on dismiss helper if no parent state

* carefullyGetParent instead of getParentState
This commit is contained in:
Brent Vatne
2018-03-12 16:01:29 -07:00
committed by GitHub
parent 052d22804c
commit 9a6e0bbd98
5 changed files with 48 additions and 2 deletions

View File

@@ -49,7 +49,8 @@ class MyNavScreen extends React.Component<MyNavScreenProps> {
/>
<Button onPress={() => navigation.popToTop()} title="Pop to top" />
<Button onPress={() => navigation.pop()} title="Pop" />
<Button onPress={() => navigation.goBack(null)} title="Go back" />
<Button onPress={() => navigation.goBack()} title="Go back" />
<Button onPress={() => navigation.dismiss()} title="Dismiss" />
<StatusBar barStyle="default" />
</SafeAreaView>
);