MFML - v0.0.4
    Preparing search index...

    Function createReactDOMElementRenderer

    • Creates element renderer that produces React DOM elements:

      • If tag name is among keys of components, then the corresponding component is rendered.
      • If tag name consists of lower case alpha characters then a DOM element is rendered.
      • Otherwise, null is returned.

      Attributes handling:

      • class attribute is transformed into a className property.
      • style attribute is parsed as a CSS text and transformed into a style property.
      • Other attributes are preserved as-is.

      Parameters

      • Optionalcomponents: { [tagName: string]: string | ComponentType<any> }

        A mapping from an element tag name to a component.

      Returns ElementRenderer<ReactNode>

      function Tooltip(props) {
      return <div title={props.title}>{props.children}</div>;
      }

      const myRenderer = createReactDOMElementRenderer({
      p: 'div',
      Tooltip,
      });

      <MessageRendererProvider value={myRenderer}>
      {...}
      </MessageRendererProvider>