Options
All
  • Public
  • Public/Protected
  • All
Menu

@atlasgroup/react-wrap

Index

Functions

Functions

  • fastWrap<V, C>(View: V, useController: C): FC<InferProps<C>>
  • Unlike wrap, fastWrap doesn't allow children to fall through

    Type parameters

    • V: FunctionComponent<any, V>

    • C: (argsObj: any) => PropsWithChildren<PropsWithoutRef<ComponentProps<V>>>

    Parameters

    • View: V

      A view component

    • useController: C

      A controller hook, can be parametrized with a object parameter

    Returns FC<InferProps<C>>

  • memoWrap<V, C>(View: V, useController: C, propsAreEqual?: (prevProps: Readonly<InferProps<C>>, nextProps: Readonly<InferProps<C>>) => boolean): NamedExoticComponent<PropsWithChildren<InferProps<C>>>
  • Creates a memoized implementation wrap

    Type parameters

    • V: FunctionComponent<any, V>

    • C: (argsObj: any) => PropsWithChildren<PropsWithoutRef<ComponentProps<V>>>

    Parameters

    • View: V

      A view component

    • useController: C

      A controller hook, can be parametrized with a object parameter

    • Optional propsAreEqual: (prevProps: Readonly<InferProps<C>>, nextProps: Readonly<InferProps<C>>) => boolean

      Like React.memo, a custom propsAreEqual can be defined to change the way component rerendering behaves

        • (prevProps: Readonly<InferProps<C>>, nextProps: Readonly<InferProps<C>>): boolean
        • Parameters

          • prevProps: Readonly<InferProps<C>>
          • nextProps: Readonly<InferProps<C>>

          Returns boolean

    Returns NamedExoticComponent<PropsWithChildren<InferProps<C>>>

  • wrap<V, C>(View: V, useController: C): FC<InferProps<C>>
  • Creates an implementation of a wrapped component using a View and a Controller hook

    Type parameters

    • V: FunctionComponent<any, V>

    • C: (argsObj: any) => PropsWithChildren<PropsWithoutRef<ComponentProps<V>>>

    Parameters

    • View: V

      A view component

    • useController: C

      A controller hook, can be parametrized with a object parameter

    Returns FC<InferProps<C>>

Generated using TypeDoc