jsx-md
Version:
Generate markdown files with a React-like syntax.
15 lines (14 loc) • 460 B
TypeScript
import { Component, MarkdownElement } from ".";
/**
* Wraps a function that returns a promise to be a valid component
* @example
* ```jsx
* const AsyncText = awaitComponent(async ({ children }) => (
* <Text>{children}</Text>
* ));
* render(<AsyncText>Test</AsyncText>))
* ===
* `Hello`
* ```
*/
export declare function awaitComponent<Props>(componentFn: (props: Props) => Promise<MarkdownElement<Props> | null>): Component<Props>;