, free & fully virtual. June 9th - 10th. Register Now

realm.isClosed is undefined

Link to gist

I modified the example app in the Realm doc to use newer API’s like Hooks. The app crashes in the second useEffect() used to replace the deprecated componentWillUnmount() method. The error states that realm.isClosed is undefined.

Any idea what is causing the error?

I discovered that the error was not Realm related. I was using Hooks incorrectly. The gist will show the updated code.