realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

useObject and reinsertion item

Open astrahov opened this issue 8 months ago • 2 comments

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

astrahov avatar May 29 '24 11:05 astrahov