diff --git a/CHANGELOG.md b/CHANGELOG.md index 612392453b9..2f8c537c61f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,13 +34,14 @@ realm.write(() => { ### Fixed * Fixed build error (call to implicitly-deleted copy constructor of 'realm::js::RealmClass::Arguments') (follow up to [#4568](https://github.com/realm/realm-js/pull/4568)) +* Fixed a few TS errors in the `@realm/react` package, introduced by ([#4537](https://github.com/realm/realm-js/pull/4537)). ### Compatibility * Atlas App Services. * Realm Studio v11.0.0. * APIs are backwards compatible with all previous releases of Realm JavaScript in the 10.5.x series. * File format: generates Realms with format v22 (reads and upgrades file format v5 or later for non-synced Realm, upgrades file format v10 or later for synced Realms). - + ### Internal * Remove the previous implementation to the JavaScriptCore engine (in `src/jsc`). * Upgrade Example to RN v0.68.2 diff --git a/packages/realm-react/src/cachedObject.ts b/packages/realm-react/src/cachedObject.ts index bfaead4a802..e7d5261e1e9 100644 --- a/packages/realm-react/src/cachedObject.ts +++ b/packages/realm-react/src/cachedObject.ts @@ -49,7 +49,7 @@ type CachedObjectArgs = { * @param args - {@link CachedObjectArgs} object arguments * @returns Proxy object wrapping the {@link Realm.Object} */ -export function createCachedObject({ +export function createCachedObject>({ object, realm, updateCallback, @@ -99,7 +99,7 @@ export function createCachedObject({ // Don't force a second re-render if any of the changed properties is a Realm.List, // as the List's cachedCollection will force a re-render itself const anyListPropertyModified = changes.changedProperties.some((property) => { - return obj[property as keyof T] instanceof Realm.List; + return obj[property as keyof Realm.Object] instanceof Realm.List; }); const shouldRerender = !anyListPropertyModified; diff --git a/types/index.d.ts b/types/index.d.ts index 8b923e51583..c88b3ca3147 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -277,7 +277,7 @@ declare namespace Realm { changedProperties: (keyof T)[] } - type ObjectChangeCallback = (object: T, changes: ObjectChangeSet) => void; + type ObjectChangeCallback = (object: Object, changes: ObjectChangeSet) => void; /** * Object