API reference › @evolu/react-native › createRun
Call Signature
function createRun(): DisposableRun;
Defined in: react-native/src/Task.ts:53
Creates a root Run for React Native.
Defects are reported with React Native's global ErrorUtils.reportError as
an Error from defectToError, because React Native shows any other
value only as unhelpful text. A custom reportDefect dependency overrides
the React Native default. The platform-independent microtask reporter is used
when ErrorUtils is absent.
Example
import {
assertSame,
createConsole,
createConsoleFormatter,
ok,
} from "@evolu/common";
import { createRun } from "@evolu/react-native";
const console = createConsole({
formatter: createConsoleFormatter()({
timestampFormat: "relative",
}),
});
await using run = createRun({ console });
const appPromise = run.ok(() => ok("started"));
assertSame(await appPromise, "started");
Call Signature
function createRun<D extends object>(deps: RunCustomDeps<D>): DisposableRun<D>;
Defined in: react-native/src/Task.ts:56
Creates a root Run for React Native with custom dependencies.