react-compinators
    Preparing search index...

    Function mapProp

    • Just like mapProps but for a single prop. The component will be given its props unmodified, except for a single prop where the value will be the result of the given function. The given function is given the original prop value.

      Type Parameters

      • Prop extends string

        Type of prop name.

      • B

        Type of given prop value.

      • A

        Type of prop value as expected by the base component.

      Parameters

      • f: (b: B) => A

        The function that will be run over the prop value.

      • prop: Prop

        The prop name to be mapped over.

      • displayName: string = ...

        Optional displayName wrapper. Defaults to mapProp.

      Returns <Props extends Record<Prop, A>>(
          Base: FC<Props>,
      ) => FC<Omit<Props, Prop> & Record<Prop, B>>

        • <Props extends Record<Prop, A>>(
              Base: FC<Props>,
          ): FC<Omit<Props, Prop> & Record<Prop, B>>
        • Type Parameters

          • Props extends Record<Prop, A>

          Parameters

          • Base: FC<Props>

            Base component that accepts a prop of type Props.

          Returns FC<Omit<Props, Prop> & Record<Prop, B>>