Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ScrubberHead<SS>

ScrubberHead renders a triangle on top of a series of timeline tracks with which the user can can seek through the current timeline by dragging it left and right. The component must be initialised with the width of the timeline it is associated with in pixels and an initial head position. One can also specify offsets to the left and right and a callback which is invoked every time the head is moved by the user.

param

The total width of the timeline (in pixels)

param

The initial position of the scrubber head (in pixels). Optional

param

The margins of the timeline to the left and right. Optional, given as [lmargin, rmargin]

param

Callback invoked whenever the user moves the scrubber head. Receives the new position

Type parameters

  • SS

Hierarchy

Index

Constructors

constructor

  • Parameters

    Returns ScrubberHead

Properties

context

context: any

props

props: Readonly<object> & Readonly<ScrubberHeadProps>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<ScrubberHeadState>

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<ScrubberHeadProps>, nextContext: any): void

Optional UNSAFE_componentWillUpdate

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 compoment is mounted. Setting state here will trigger re-rendering.

    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<ScrubberHeadProps>, 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

forceUpdate

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

    • Optional callBack: undefined | function

    Returns void

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

Private headPositionUpdated

  • headPositionUpdated(newPosition: number): void
  • Callback invoked in response to the user dragging the scrubber head along the timeline. Receives the updated position as parameter, invokes the headPositionUpdated() function passed in as prop and updates state.

    Parameters

    • newPosition: number

      The updated head position

    Returns void

render

  • render(): Element
  • Renders the component.

    Returns Element

setState

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

    • K: keyof ScrubberHeadState

    Parameters

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

    Returns void

Optional shouldComponentUpdate

  • 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

Generated using TypeDoc