react-compinators
    Preparing search index...

    Function requireProp

    • Convert a component that takes an optional prop prop into a component where the prop is required. The opposite of withDefault.

      Type Parameters

      • Prop extends string

        Type of prop name. Must exist as optional field on Base props.

      Parameters

      • prop: Prop

        Name of optional prop to convert.

      Returns <BaseProps extends { [key in string]?: unknown }>(
          Base: FC<BaseProps>,
      ) => FC<Simplify<WithRequiredProp<Prop, BaseProps>>>