Options
All
  • Public
  • Public/Protected
  • All
Menu

Module react

Index

References

Renames and re-exports slot

Type Aliases

AnyComponent<P>: Component<P> | FC<P>

Type Parameters

  • P

CreateSlot: { (computeFn: (() => any)): ReactNode; <A>(computeFn: ((...args: A) => any), ...args: A): ReactNode }

Type declaration

    • (computeFn: (() => any)): ReactNode
    • <A>(computeFn: ((...args: A) => any), ...args: A): ReactNode
    • Parameters

      • computeFn: (() => any)
          • (): any
          • Returns any

      Returns ReactNode

    • Type Parameters

      • A extends any[]

      Parameters

      • computeFn: ((...args: A) => any)
          • (...args: A): any
          • Parameters

            • Rest ...args: A

            Returns any

      • Rest ...args: A

      Returns ReactNode

Directive<E>: ((ref: E) => void | VoidFunction)

Type Parameters

  • E

Type declaration

    • (ref: E): void | VoidFunction
    • Parameters

      • ref: E

      Returns void | VoidFunction

Effect<R>: ((context: EffectContext<R>) => void | VoidFunction)

Type Parameters

  • R = any

Type declaration

EffectContext<R>: { refs: Refs<R> }

Type Parameters

  • R

Type declaration

Refs<T, F>: { [ key in keyof T]: T[key] } & { [ key in `${keyof T & string}Ref`]: RefObject<any> } & { forwardedRef: ForwardedRef<F> }

Type Parameters

  • T extends Record<string, any> = {}

  • F = any

StableOptions: { name?: string }

Type declaration

  • Optional name?: string

Functions

  • defaultProps<T>(props: T, defaultValues: Partial<T>): void
  • effect(onMount: Effect<any>, onRender?: VoidFunction): void
  • slot(computeFn: (() => any)): ReactNode
  • slot<A>(computeFn: ((...args: A) => any), ...args: A): ReactNode
  • create a slot that update automatically when input atom/computed value is changed

    Parameters

    • computeFn: (() => any)
        • (): any
        • Returns any

    Returns ReactNode

  • create a slot that update automatically when input atom/computed value is changed

    Type Parameters

    • A extends any[]

    Parameters

    • computeFn: ((...args: A) => any)
        • (...args: A): any
        • Parameters

          • Rest ...args: A

          Returns any

    • Rest ...args: A

    Returns ReactNode

  • stable<P, R>(component: ((props: P, refs: R) => any), options?: StableOptions): ForwardRefExoticComponent<P & RefAttributes<R extends Refs<_R, F> ? undefined | F : any>>
  • Type Parameters

    • P extends Record<string, any>

    • R extends Refs<{}, any>

    Parameters

    • component: ((props: P, refs: R) => any)
        • (props: P, refs: R): any
        • Parameters

          • props: P
          • refs: R

          Returns any

    • Optional options: StableOptions

    Returns ForwardRefExoticComponent<P & RefAttributes<R extends Refs<_R, F> ? undefined | F : any>>

  • useReactive<T>(reactiveFn: (() => T)): any
  • the host component will be re-rendered whenever reactive value changed

    Type Parameters

    • T

    Parameters

    • reactiveFn: (() => T)
        • (): T
        • Returns T

    Returns any

Generated using TypeDoc