New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined is not a function
when using useObject
#5058
Comments
Another user reported the same thing but an update solved the issue. Can it be an issue with a build cache? |
@kneth Hi thanksfor the quick reply. The problem here is that the |
@RenaudAubert I can see the issue in our current implementation. We are checking of the property of an object is an instance of We will look into this right away and update you here when a fix is available. Thanks for reporting this! |
@takameyer Thank you 🙏 |
@RenaudAubert This should be fixed now. Please use |
@takameyer I confirm I no longer have an error thrown when accessing a value from an array of primitives. Thank you very much |
How frequently does the bug occur?
All the time
Description
Hi !
I have a react-native project using
"realm": "^11.1.0"
,"@realm/react": "^0.4.0"
and"react-native": "0.70.4"
.I'm using
useObject
to retrieve an object and it's working fine until I try to access a property being an array of string.Here's what my code looks like
Getting any
project
value works fine even getting elements insidecontracts
which is an array of contract objects but when trying to get elements insidestringArray1
orstringArray2
I get this error.I looked at the stack trace and the problem seems to come from this line.
In my case
object
is a string andobject._objectKey
is not defined.It works when I shallow copy the array because it is not using the proxy anymore.
Please let me know if I'm using realm or react-realm incorrectly or if you need more informations.
Stacktrace & log output
Can you reproduce the bug?
Yes, always
Reproduction Steps
To reproduce create a model with a property being an array of strings
And inside a react component, retrieve an element of the array of string from this object
Version
11.1.0 and 11.0.0
What SDK flavour are you using?
Atlas Device Sync
Are you using encryption?
No, not using encryption
Platform OS and version(s)
Android 12
Build environment
I'm using Windows 10 version 21H2 to emulate (emulator version 31.2.10) a Pixel 4 phone running on Android 12
The text was updated successfully, but these errors were encountered: