realm-js
realm-js copied to clipboard
useObject and reinsertion item
How frequently does the bug occur?
Always
Description
When deleting and recreating an object, the deletion is handled properly and the object becomes null. However after reinsertion it stays null.
The temporary fix of @mordechaim worked: https://github.com/realm/realm-js/issues/4514#issuecomment-1117666924
// replace this
const cat = useObject('Cat', 'id-1')
// with
const cat = useQuery('Cat').filtered('id == $0', 'id-1')[0]
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
No response
Version
12.9.0
What services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
iOS 17.5
Build environment
{
"dependencies": {
"react": "18.2.0",
"react-native": "0.74.1",
"realm": "12.9.0",
},
}
Cocoapods version
1.14.3