react-compinators
    Preparing search index...

    Function modProp

    • Modify the props input of the given component by applying a function of type <A>(a: A) => A over a named prop value. Useful when you can compute the new value from the old one and nothing else, and you do not need to change the prop type.

      Type Parameters

      • Prop extends string

        Type of modified prop name.

      • Value

        Modified prop value type.

      Parameters

      • propName: Prop

        Name of prop to modify.

      • modify: (value: Value) => Value

        The mapping function will be applied to the prop value.

      • OptionalmaybeNameWrapper: string

        Optional displayName wrapper will be added to base component displayName. Default is computed modified given prop name.

      Returns <Props extends Record<Prop, Value>>(Base: FC<Props>) => FC<Props>

        • <Props extends Record<Prop, Value>>(Base: FC<Props>): FC<Props>
        • Type Parameters

          Parameters

          • Base: FC<Props>

            Component to modify.

          Returns FC<Props>