react-native-share-menu
react-native-share-menu copied to clipboard
allow to update delegate every time attachViewDelegate called.
this PR is related to this issue https://github.com/meedan/react-native-share-menu/issues/135.
I tested this and it seems to work!
Me too. Please merge. However I would prefer to delete the line instead of commenting it out.
It is working!
Please merge this PR
Maybe if it can help someone. Here are some details...
The lib is composed of
- A derivation of UIViewController, an apple primitive to present things. This is an instance.
- A single static object to expose functions to react/java (which point to a single ViewController)
The lib takes one of the following wrong assumption:
- Only 1 UIViewController exist at a given moment (not clear given the complexity of view system)
- The system will always call viewDidDisappear (most likely the bug when switching app)
The ok-but-not-great fix is to comment or remove the guard as proposed. It clean the left over UIViewController instance in the static object. Ideally someone with experience with the lib would evaluate and fix it by finding the others path of cleanup (when switching app for example).
In time being patch-package can be your friend, it is simple to use:
https://dev.to/zhnedyalkow/the-easiest-way-to-patch-your-npm-package-4ece
Maybe if it can help someone. Here are some details...
The lib is composed of
- A derivation of UIViewController, an apple primitive to present things. This is an instance.
- A single static object to expose functions to react/java (which point to a single ViewController)
The lib takes one of the following wrong assumption:
- Only 1 UIViewController exist at a given moment (not clear given the complexity of view system)
- The system will always call viewDidDisappear (most likely the bug when switching app)
The ok-but-not-great fix is to comment or remove the guard as proposed. It clean the left over UIViewController instance in the static object. Ideally someone with experience with the lib would evaluate and fix it by finding the others path of cleanup (when switching app for example).
In time being patch-package can be your friend, it is simple to use:
https://dev.to/zhnedyalkow/the-easiest-way-to-patch-your-npm-package-4ece