useObject: causing re-render continously

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

      How frequently does the bug occur?

      Always

      Description

      The underlying schema I'm referencing in useObject and the primary key are not changing at all which I've verified but the hook still returns brand new objects from the DB every few seconds.

      I've had to solve this by manually writing the query using this alternative instead:

      Unable to find source-code formatter for language: jsx. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      const data = useMemo(() => realm.objectForPrimaryKey(MySchema, variableWithId), [variableWithId]);
      

      According to the docs the hook is supposed to only update on changes to the properties on the returned object?
      > The hook will update on any changes to the properties on the returned object and return null if it either doesn't exists or has been deleted.

      I've verified that isn't the case. The properties are being read from only - not modified.

      Stacktrace & log output

      No response

      Can you reproduce the bug?

      Yes

      Reproduction Steps

      1. Have a valid Realm DB with a large Realm schema with some data
      2. Use useObject() in a React component
      3. Observe component re-render continously

      Version

      0.6.1

      What services are you using?

      Local Database only

      Are you using encryption?

      No

      Platform OS and version(s)

      realm 12.3

      Build environment

      react-native: 0.73.6
      expo: 50.0.0
      react: 18.2.0
      react-dom: 18.2.0

      Cocoapods version

      No response

              Assignee:
              Unassigned
              Reporter:
              Unito Sync Bot
              Archiver:
              Marc Greenfield

                Created:
                Updated:
                Resolved:
                Archived: