Skip to main content

RenderersProps

export
interface RenderersProps {
  a: {
    onPress?: (
      event: GestureResponderEvent,
      href: string,
      htmlAttribs: Record<string, string>,
      target: "_blank"
        | "_self"
        | "_parent"
        | "_top"
    ) => void;
  };
  img: {
    enableExperimentalPercentWidth?: boolean;
    initialDimensions?: ImageDimensions;
  };
  ol: ListElementConfig;
  ul: ListElementConfig;
}

Props for custom renderers. The convention is to declare a field per tag name. In doing so, you can benefit from useRendererProps('tagname') in custom renderers.

Remarks

Typescript users: If you need to add fields to the ​RenderersProps interface, you should use module augmentation:

declare module 'react-native-render-html' {
interface RenderersProps {
div?: {
customProp: boolean;
};
}
}
@public

Fields#

a#

required
a: {
  onPress?: (
    event: GestureResponderEvent,
    href: string,
    htmlAttribs: Record<string, string>,
    target: "_blank"
      | "_self"
      | "_parent"
      | "_top"
  ) => void;
};

img#

required
img: {
  enableExperimentalPercentWidth?: boolean;
  initialDimensions?: ImageDimensions;
};

ol#

required

ul#

required