Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GenericScreen<S, SS, S>

特有の機能を持たないスクリーン。1つのReactコンポーネントで画面全体を構成する。

Type parameters

  • S

  • SS

  • S

Hierarchy

  • Component<GenericScreenProps>
    • GenericScreen

Index

Constructors

constructor

  • new GenericScreen(props: Readonly<GenericScreenProps>): GenericScreen
  • new GenericScreen(props: GenericScreenProps, context?: any): GenericScreen
  • Parameters

    • props: Readonly<GenericScreenProps>

    Returns GenericScreen

  • Parameters

    • props: GenericScreenProps
    • Optional context: any

    Returns GenericScreen

Properties

context

context: any

props

props: Readonly<object> & Readonly<GenericScreenProps>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<S>

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<GenericScreenProps>, nextContext: any): void
  • Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.

    Calling Component#setState generally does not trigger this method.

    This method will not stop working in React 17.

    Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.

    deprecated

    16.3, use static getDerivedStateFromProps instead

    see

    https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props

    see

    https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path

    Parameters

    • nextProps: Readonly<GenericScreenProps>
    • nextContext: any

    Returns void

Optional UNSAFE_componentWillUpdate

  • UNSAFE_componentWillUpdate(nextProps: Readonly<GenericScreenProps>, nextState: Readonly<S>, 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

Optional componentDidMount

  • componentDidMount(): void
  • Called immediately after a component is mounted. Setting state here will trigger re-rendering.

    Returns void

Optional componentDidUpdate

  • componentDidUpdate(prevProps: Readonly<GenericScreenProps>, prevState: Readonly<S>, snapshot?: SS): void
  • 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

    • prevProps: Readonly<GenericScreenProps>
    • prevState: Readonly<S>
    • Optional snapshot: SS

    Returns void

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<GenericScreenProps>, nextContext: any): void

Optional componentWillUnmount

  • componentWillUnmount(): 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

Optional componentWillUpdate

  • componentWillUpdate(nextProps: Readonly<GenericScreenProps>, nextState: Readonly<S>, nextContext: any): void

forceUpdate

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

    • Optional callBack: function
        • (): void
        • Returns void

    Returns void

Optional getSnapshotBeforeUpdate

  • getSnapshotBeforeUpdate(prevProps: Readonly<GenericScreenProps>, prevState: Readonly<S>): SS | null
  • 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

    • prevProps: Readonly<GenericScreenProps>
    • prevState: Readonly<S>

    Returns SS | null

setState

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

    • K: keyof S

    Parameters

    • state: function | S | object
    • Optional callback: function
        • (): void
        • Returns void

    Returns void

Generated using TypeDoc