Skip to content

Conversation

@sq-tupai
Copy link

Hi there, I'v add two methods to control the native view's visibility on Android, it aims to solve the native map view overlapping issue in navigate between pages which all contain maps component.

With these two methods, in Ionic react page, we can hide the native map before leave, and show it before enter.

useIonViewWillEnter(() => {
  map.current?.show().then(() => {
    console.log('map visible');
  });
});

useIonViewWillLeave(() => {
  setLocationId(undefined);
  map.current?.hide().then(() => {
    console.log('map invisible');
  });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant