Open dkr13 opened 2 years ago
Is this issue similar to this one: RCTModalHostViewController Attempt to present <iOSPhotoEditor.PhotoEditorViewController: 0x104018000> on <RCTModalHostViewController: 0x118682e60> (from <RCTModalHostViewController: 0x118682e60>) whose view is not in the window hierarchy.
Thank you,
Yes @mmenacer this issue is similar to what you posted. I am also facing the same issue.
@akhilesh-mourya
I found the issue and a solution for this issue. The issue is only for iOS platform.
The problem is that the app has more than 2 modals open. And if you open the image picker it will be the 3rd modal (on open state). So to fix the issue. You have to make sure that you closed the 1st modal. I used in my solution:
const onOpenAssignUsers = useCallback(() => {
// closes the 1st modal
setModalOneVisible(false);
// open the 2nd modal
setTimeout(
() => {
setModalTwoVisible(true);
},
// any small number will do, maybe animation duration
100,
);
}, []);
If you can not close it so the solution is to convert all your modals that they are before the react picker modal to a view/screen components.
I'm using react-native-image-picker to let the user select an image from the gallery. When I try to use the returned value with the PhotoEditor, I get the following error message in Xcode:
Here's the code that I use to launch the PhotoEditor:
response.uri
is the value returned fromreact-native-image-picker
and is similar to the following (which is a path to an image, that exists on my system.There is a similar issue from 2019, but the author says it works with
react-native-image-picker
. Am I correct with the assumption, thatreact-native-image-picker
moves the image to the app sandbox?Can anybody help me with this problem and know, why
PHPickerViewController
is not loaded into the hierarchy?