Function createRealmContext

  • Creates Realm React hooks and Provider component for a given Realm configuration

    Parameters

    Returns RealmContext

    An object containing a RealmProvider component, and useRealm, useQuery and useObject hooks

    Example

    class Task extends Realm.Object {
    ...

    static schema = {
    name: 'Task',
    primaryKey: '_id',
    properties: {
    ...
    },
    };
    }

    const {useRealm, useQuery, useObject, RealmProvider} = createRealmContext({schema: [Task]});

Generated using TypeDoc