Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TabScreen<SS>

複数のコンテンツコンポーネントと、タブコンポーネント、双方を囲むコンポーネントを持つスクリーン。 タブスクリーンインスタンスにはscreenProps.screenAttributes.tabScreenでアクセスすることができ、表示タブ変更などの操作メソッドを実行出来ます。

Type parameters

  • SS

Hierarchy

  • Component<TabScreenProps, TabScreenState>
    • TabScreen

Index

Properties

context

context: any

props

props: Readonly<object> & Readonly<TabScreenProps>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<TabScreenState>

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<TabScreenProps>, 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<TabScreenProps>
    • nextContext: any

    Returns void

Optional UNSAFE_componentWillUpdate

  • UNSAFE_componentWillUpdate(nextProps: Readonly<TabScreenProps>, nextState: Readonly<TabScreenState>, nextContext: any): void

addTabChangingListener

  • 表示するコンテンツコンポーネントが変更された時に、登録したコールバックを実行する

    Parameters

    • callback: function
        • (prevIndex: number, nextIndex: number, payload?: any): void
        • Parameters

          • prevIndex: number
          • nextIndex: number
          • Optional payload: any

          Returns void

    Returns TabEventSubscription

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<TabScreenProps>, prevState: Readonly<TabScreenState>, 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<TabScreenProps>
    • prevState: Readonly<TabScreenState>
    • Optional snapshot: SS

    Returns void

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<TabScreenProps>, 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<TabScreenProps>, nextState: Readonly<TabScreenState>, nextContext: any): void

currentIndex

  • currentIndex(): number
  • 現在表示しているコンテンツの配列インデックスを返す

    Returns number

forceUpdate

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

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

    Returns void

Optional getSnapshotBeforeUpdate

  • getSnapshotBeforeUpdate(prevProps: Readonly<TabScreenProps>, prevState: Readonly<TabScreenState>): 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<TabScreenProps>
    • prevState: Readonly<TabScreenState>

    Returns SS | null

setState

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

    • K: keyof TabScreenState

    Parameters

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

    Returns void

switchTab

  • switchTab(index: number, payload?: any): void
  • 表示するコンテンツコンポーネントを変更する

    Parameters

    • index: number
    • Optional payload: any

    Returns void

Generated using TypeDoc