MarkdownComponentProps
Unpublished development API. This package is under development and is not available as a published release.
What a replacement for one node type receives.
import type { MarkdownComponentProps } from '@threadplane/react/markdown';Declaration
export interface MarkdownComponentProps<T extends MarkdownNodeType = MarkdownNodeType> {
readonly children: ReactNode;
readonly defaultView: ReactNode;
readonly node: Extract<MarkdownNode, {
readonly type: T;
}>;
readonly url: string | undefined;
}Type parameters
TMarkdownNodeTypeDefault:MarkdownNodeType
Members
children
The node's children, already rendered (and replaced where an entry asks). Null for a leaf.
readonly children: ReactNode;defaultView
The built-in rendering of this node, to wrap or to fall back to while it streams.
readonly defaultView: ReactNode;node
The node, including its streaming status; 'complete' once its source is closed.
readonly node: Extract<MarkdownNode, {
readonly type: T;
}>;url
The link or image URL after the library's URL policy, or undefined when the policy refused it
or the node has none. Use it instead of node.url.
readonly url: string | undefined;