Skip to content

Realm React v0.7.0

Compare
Choose a tag to compare
@elle-j elle-j released this 08 May 11:24
6e93706

Deprecations

  • Deprecated calling useQuery with three positional arguments. (#6360)

    Please pass a single "options" object followed by an optional deps argument (if your query depends on any local variables):

    const filteredAndSorted = useQuery({
      type: Object,
      query: (collection) => collection.filtered('category == $0',category).sorted('name'),
    }, [category]);

Enhancements

  • Adding the ability to pass "options" to useQuery and useObject as an object. (#6360)
  • Adding keyPaths option to the useQuery and useObject hooks, to indicate a lower bound on the changes relevant for the hook. This is a lower bound, since if multiple hooks add listeners (each with their own keyPaths) the union of these key-paths will determine the changes that are considered relevant for all listeners registered on the collection or object. In other words: A listener might fire and cause a re-render more than the key-paths specify, if other listeners with different key-paths are present. (#6360)

Fixed

  • Removed race condition in useObject. (#6291) Thanks @bimusik!
  • Fixed flickering of the RealmProvider's fallback component and its children when offline. (#6333)

Compatibility

  • React Native >= v0.71.4
  • See "Compatibility" for a specific Realm version in Realm's CHANGELOG.