@mittwald/react-use-promise
Version:
Simple and declarative use of Promises in your React components. Observe their state and refresh them in various advanced ways.
10 lines (9 loc) • 331 B
JavaScript
import { expectType } from "tsd";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function testResultOfWatchMatchesAsyncLoaderReturnType() {
const resource = {};
const result = resource.use();
expectType(result);
// @ts-expect-error Test access to unknown props
console.log(result.unknownProp);
}