I would like to do an operation just before the app is closed.
I try to put this operation in the useeffect return function when the component get unmounted but i get the following error :
LOG [Error: Cannot access realm that has been closed.]
e.g :
You could take the closing of Realm in your own hands by adding closeOnUnmount={false} to the RealmProvider props. This will make the RealmProvider skip closing the realm as the app is closed.
Yes i have seen this option this morning so i will try it a bit later but it seems to be what i needed.
I will tag this answer as “solution” if it fixes my issue
Thank you for your answer
Also i have seen a request about adding props to the realmProvider such as onOpen or onClose that would be a nice solution for nice setup and cleanup of realm data :