You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
setting up a new App and just started learning how to use Realm and noticed this issue with useQuery and filtered() where filtered() will return a new object every render. I've managed to get around this by manually memorizing based on useQuery but I'm pretty sure this is a bug.
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
const useItems = (parentId: number) => {
const {useQuery} = useRealmContext(); // useQuery doesn't work globally at the moment, the Provider also seems broken.
const items = useQuery(Item); // this is fine, doesn't change
useEffect(() => {
// only when parentId changes as expected
}, [items])
const filteredItems = items.filtered("parentId = $0", parentId); // this is a new object
useEffect(() => {
// every render
}, [filteredItems])
return filteredItems
}
Version
0.5.1
What services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
React-Native, Expo, Android
Build environment
Which debugger for React Native: ..
Cocoapods version
No response
The text was updated successfully, but these errors were encountered:
How frequently does the bug occur?
Always
Description
setting up a new App and just started learning how to use Realm and noticed this issue with useQuery and filtered() where filtered() will return a new object every render. I've managed to get around this by manually memorizing based on useQuery but I'm pretty sure this is a bug.
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
Version
0.5.1
What services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
React-Native, Expo, Android
Build environment
Which debugger for React Native: ..
Cocoapods version
No response
The text was updated successfully, but these errors were encountered: