Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StartPage<SS>

StartPage is a Redux-connected component responsible for loading the initial document, parsing it and creating the required data structures in the Redux state tree. It receives all its props via the Redux state tree.

Type parameters

  • SS

Hierarchy

Index

Constructors

constructor

  • Parameters

    • props: never

    Returns StartPage

Properties

context

context: any

Private fileInput

fileInput: Nullable<HTMLInputElement>

Private idInput

idInput: Nullable<HTMLSelectElement>

props

props: Readonly<object> & Readonly<StartPageProps>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<StartPageState>

Private urlInput

urlInput: Nullable<HTMLInputElement>

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<StartPageProps>, 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

componentDidUpdate

  • Callback which is invoked after the component updated. Here this is used after a new document ID has been assigned to the Redux state tree. It requests all data associated to the document from the server, parses it and allocated the relevant data structures in the redux state tree. This is only done if the document ID is non-empty. Navigates to the LayoutDesigner component after all data has been processed.

    Parameters

    Returns Promise<void>

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<StartPageProps>, 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

render

  • render(): Element
  • Renders the component

    Returns Element

setState

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

    • K: keyof StartPageState

    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

Private submitForm

  • submitForm(ev: FormEvent<HTMLFormElement>): Promise<void>
  • Callback invoked in response to submission of the form. It can either take a URL to an existing document, the ID of a document which already exists on the server or a document uploaded from the local file system. After uploading the data to the server, it receives the new document ID and updates the Redux state accordingly, which in turn triggers componentDidUpdate(). That function will then retrieve the processed document data from the server, generate the state tree and redirect to the LayoutDesigner.

    Parameters

    • ev: FormEvent<HTMLFormElement>

      The original form event triggered by the submission

    Returns Promise<void>

Generated using TypeDoc