Class Component<P, S, SS>

Base RS Components. All components in the application should be inherited from this class or its subclasses.

Type Parameters

  • P = {}
  • S = {}
  • SS = any

Hierarchy (view full)

Constructors

  • Type Parameters

    • P = {}
    • S = {}
    • SS = any

    Parameters

    • props: P

    Returns Component<P, S, SS>

  • Type Parameters

    • P = {}
    • S = {}
    • SS = any

    Parameters

    • props: P
    • context: any

    Returns Component<P, S, SS>

Properties

_mounted: boolean

Indicates if the component is mounted.

Methods

  • Called immediately after a component is mounted. Setting state here will trigger re-rendering.

    Returns void

  • Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as cancelled network requests, or cleaning up any DOM elements created in componentDidMount.

    Returns void

  • Gets the text from the dictionary as JSX object. All HTML in the text is converted to JSX.

    Type Parameters

    • T = any

    Parameters

    • key: keyof T

      Key of the text in the dictionary.

    Returns Element

    T - Type of the dictionary object -> typeof { key: 'value' }.

  • Gets the text from the dictionary as JSX object. All HTML in the text is converted to JSX.

    Type Parameters

    • T = any

    Parameters

    • key: keyof T

      Key of the text in the dictionary.

    • Rest...args: any[]

      Arguments for text format.

    Returns Element

    T - Type of the dictionary object -> typeof { key: 'value' }.

  • Gets the state key of the component instance. By default the method returns null. If it's overriden to return a string value the saveState and loadState are handled automatically in the component's lifecycle.

    Returns string

  • Gets the text from the dictionary.

    Type Parameters

    • T = any

    Parameters

    • key: keyof T

      Key of the text in the dictionary.

    Returns string

    T - Type of the dictionary object -> typeof { key: 'value' }.

  • Gets the text from the dictionary.

    Type Parameters

    • T = any

    Parameters

    • key: keyof T

      Key of the text in the dictionary.

    • Rest...args: any[]

      Arguments for text format.

    Returns string

    T - Type of the dictionary object -> typeof { key: 'value' }.

  • Loads the state from the memory storage.

    Parameters

    • key: string

      State key of the component instance.

    Returns Promise<void>

  • Method called after window.onpopstate event is triggered.

    Parameters

    • event: any

    Returns void

  • Saves the current state to the memory storage.

    Parameters

    • key: string

      State key of the component instance.

    Returns void