next-mdx-remote-client
Version:
A wrapper of the `@mdx-js/mdx` for the `nextjs` applications in order to load MDX content. It is a fork of `next-mdx-remote`.
18 lines • 631 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { hydrateLazy } from "./hydrateLazy.js";
/**
* renders the content on the client side (csr), which is provided by the "hydrateLazy" function.
*
* the content is going to be hydrated "lazily".
*/
export function MDXClientLazy(props) {
const { onError: ErrorComponent, ...rest } = props;
const { content, error } = hydrateLazy(rest);
/* v8 ignore next */
if (error && !ErrorComponent)
throw error;
if (error && ErrorComponent)
return _jsx(ErrorComponent, { error: error });
return content;
}
//# sourceMappingURL=MDXClientLazy.js.map