|
@@ -56,8 +56,8 @@ class Root extends Component {
|
56
|
56
|
url: this.props.url
|
57
|
57
|
};
|
58
|
58
|
|
59
|
|
- // Handle the URL the application was launched with, but props have
|
60
|
|
- // precedence.
|
|
59
|
+ // Handle the URL, if any, with which the app was launched. But props
|
|
60
|
+ // have precedence.
|
61
|
61
|
if (typeof this.props.url === 'undefined') {
|
62
|
62
|
Linking.getInitialURL()
|
63
|
63
|
.then(url => this.setState({ url }))
|
|
@@ -79,8 +79,10 @@ class Root extends Component {
|
79
|
79
|
*
|
80
|
80
|
* @inheritdoc
|
81
|
81
|
*/
|
82
|
|
- componentWillReceiveProps(nextProps) {
|
83
|
|
- this.setState({ url: nextProps.url || null });
|
|
82
|
+ componentWillReceiveProps({ url }) {
|
|
83
|
+ if (this.props.url !== url) {
|
|
84
|
+ this.setState({ url: url || null });
|
|
85
|
+ }
|
84
|
86
|
}
|
85
|
87
|
|
86
|
88
|
/**
|