@rjsf/core
Version:
A simple React component capable of building HTML forms out of a JSON schema.
18 lines (17 loc) • 723 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { getTestIds, getUiOptions, } from '@rjsf/utils';
import Markdown from 'markdown-to-jsx';
const TEST_IDS = getTestIds();
/** Renders the given `description` in the props as
*
* @param props - The `RichHelpProps` for this component
*/
export default function RichHelp({ help, registry, uiSchema = {}, }) {
const { globalUiOptions } = registry;
const uiOptions = getUiOptions(uiSchema, globalUiOptions);
if (uiOptions.enableMarkdownInHelp && typeof help === 'string') {
return (_jsx(Markdown, { options: { disableParsingRawHTML: true }, "data-testid": TEST_IDS.markdown, children: help }));
}
return help;
}
RichHelp.TEST_IDS = TEST_IDS;