Class BaseFormControlAbstract

This is the base form control that contains methods that render fields depending upon displayType property. Control rendering methods must be implemented in libs implementing metaform-core

Hierarchy

  • Component
    • BaseFormControl

Constructors

Properties

context: MetaForm
displayType?: string
field: IField
isFormControl: boolean
refs: {
    [key: string]: ReactInstance;
}

Type declaration

  • [key: string]: ReactInstance
section: string
state: IState
uuid: string
validation: {
    pattern: undefined | string;
    required: undefined | boolean;
}

Type declaration

  • pattern: undefined | string
  • required: undefined | boolean

Methods

  • 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

  • Parameters

    • Optional callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • 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<{}>
    • prevState: Readonly<{}>

    Returns any

  • Type Parameters

    • K extends never

    Parameters

    • state: null | {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => null | {} | Pick<{}, K>) | Pick<{}, K>
    • Optional callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • 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

    • nextProps: Readonly<{}>
    • nextState: Readonly<{}>
    • nextContext: any

    Returns boolean

Generated using TypeDoc