Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Connected<State, Derived, SS>

Type parameters

  • State

  • Derived

  • SS

Hierarchy

Index

Constructors

constructor

Properties

context

context: any

deriveState

deriveState: function

Type declaration

    • (state: State): Derived
    • Parameters

      • state: State

      Returns Derived

props

props: Readonly<object> & Readonly<ConnectedProps<State, Derived>>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

state

state: ReplaceableState<Derived>

unsubscribe

unsubscribe: Unsubscribe

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<ConnectedProps<State, Derived>>, nextContext: any): void

Optional UNSAFE_componentWillUpdate

  • UNSAFE_componentWillUpdate(nextProps: Readonly<ConnectedProps<State, Derived>>, nextState: Readonly<ReplaceableState<Derived>>, nextContext: any): void

Optional componentDidCatch

  • componentDidCatch(error: Error, errorInfo: ErrorInfo): void
  • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

    Parameters

    • error: Error
    • errorInfo: ErrorInfo

    Returns void

componentDidMount

  • componentDidMount(): void
  • Returns void

Optional componentDidUpdate

  • Called immediately after updating occurs. Not called for the initial render.

    The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.

    Parameters

    Returns void

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<ConnectedProps<State, Derived>>, nextContext: any): void

componentWillUnmount

  • componentWillUnmount(): void
  • Returns void

Optional componentWillUpdate

forceUpdate

  • forceUpdate(callBack?: undefined | function): void
  • Parameters

    • Optional callBack: undefined | function

    Returns void

getDerivedState

  • getDerivedState(): Derived

Optional getSnapshotBeforeUpdate

  • Runs before React applies the result of render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    Parameters

    Returns SS | null

onStoreUpdate

  • onStoreUpdate(): void

render

  • render(): undefined | null | string | number | false | true | __type | ReactElement<any> | ReactNodeArray | ReactPortal
  • Returns undefined | null | string | number | false | true | __type | ReactElement<any> | ReactNodeArray | ReactPortal

replace

  • replace(state: Derived): void

setState

  • setState<K>(state: function | null | S | object, callback?: undefined | function): void
  • Type parameters

    • K: keyof ReplaceableState<Derived>

    Parameters

    • state: function | null | S | object
    • Optional callback: undefined | function

    Returns void

Optional shouldComponentUpdate

  • shouldComponentUpdate(nextProps: Readonly<ConnectedProps<State, Derived>>, nextState: Readonly<ReplaceableState<Derived>>, nextContext: any): boolean
  • Called to determine whether the change in props and state should trigger a re-render.

    Component always returns true. PureComponent implements a shallow comparison on props and state and returns true if any props or states have changed.

    If false is returned, Component#render, componentWillUpdate and componentDidUpdate will not be called.

    Parameters

    Returns boolean

Object literals

Static defaultProps

defaultProps: object

deriveState

  • deriveState<T>(x: T): T

Generated using TypeDoc