Reputation: 8834
Sorry for the long winded title.
Here's my componentDidMount()
function
componentDidMount() {
Linking.getInitialURL().then(data => {
console.log(data);
});
}
When I boot up my app, data
is rightfully set to null
.
A User then logs in via Google Chrome which is opened via
Linking.open('https://...);
When the User gets redirected back to my app, I can see that data
has been populated. This is all well and good.
However, when I am redirected back, I see duplicate components. Here's a screenshot from the React Native Debugger. I have <AppContainer root=1..>
and <AppContainer root=11..>
Because of this duplication, my app calls componentDidMount()
twice and Linking.getInitialURL()
is called multiple times.
Furthermore, if I refresh the app via the developer menu, the data
returned from Linking.getInitialURL
's promise is still populated when it should be null
.
Upvotes: 1
Views: 1901