Skip to main content

useInternalRenderer

export
function useInternalRenderer<
  T extends TagName
>(
  tagName: T,
  props: InternalRendererProps<any>
) : InternalRendererConfig<ReturnType<typeof specialRenderersConfig[T]["hook"]>> | InternalRendererConfig<TDefaultRendererProps<any>>

Resuse internal renderers logic for infinite customization!

Remarks

tagName must be invariant, i.e. it cannot change. You would otherwise break the rules of hooks.

Type Parameters#

T#

The name of the tag to target.

Parameters#

tagName#

required
tagName: T;

Invariant The tag name to extend.

props#

required

The props passed to the custom renderer.

Returns#

An object with two fields: Renderer (the internal react component) and rendererProps, the internal component props.