@suspensive/react-query-5
Version:
Suspensive interfaces for @tanstack/react-query@5
31 lines (28 loc) • 1.06 kB
JavaScript
'use client';
import { _objectWithoutProperties } from "./_virtual/_@oxc-project_runtime@0.130.0/helpers/objectWithoutProperties.mjs";
import { useSuspenseQuery } from "@tanstack/react-query";
import { Fragment, jsx } from "react/jsx-runtime";
//#region src/SuspenseQuery.tsx
const _excluded = ["children"];
/**
* We provide these components to clearly express what causes suspense at the same depth.
* `<SuspenseQuery/>` serves to make `useSuspenseQuery` easier to use in jsx.
* @see {@link https://suspensive.org/docs/react-query/SuspenseQuery Suspensive Docs}
* @example
* ```tsx
* import { SuspenseQuery } from '@suspensive/react-query'
*
* // You can use queryOptions as props.
* <SuspenseQuery {...queryOptions()}>
* {({ data }) => {
* return <></>
* }}
* </SuspenseQuery>
*/
const SuspenseQuery = (_ref) => {
let { children } = _ref;
return /* @__PURE__ */ jsx(Fragment, { children: children(useSuspenseQuery(_objectWithoutProperties(_ref, _excluded))) });
};
//#endregion
export { SuspenseQuery };
//# sourceMappingURL=SuspenseQuery.mjs.map