Lilact
    Preparing search index...

    Class Component

    Base class that mimics React.Component (stateful component with lifecycle hooks). Extend this class to implement render() and (optionally) override lifecycle methods.

    These user functions and members are supported:

    static defaultProps
    
    render() {}
    
    componentWillReceiveProps (nextProps)
    componentWillUpdate (nextProps, nextState)
    componentDidCatch (error, info) 	
    componentDidMount () 			
    componentDidUpdate (prevProps, prevState, lastSnapshot) 
    componentWillUnmount () 
    getSnapshotBeforeUpdate (prevProps, prevState) 
    shouldComponentUpdate (nextProps, nextState) 
    
    static getDerivedStateFromError (error) {}
    static getDerivedStateFromProps (props, state) {}
    

    For more details see official React documentation.

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • props: any

      Returns Component

    Accessors

    • get context(): any
      Protected

      Component context.

      Returns any

    • set context(v: any): void

      Parameters

      • v: any

      Returns void

    • get key(): string | number

      A unique identifier for the component instance. The key is immutable and can only be set when the component is declared.

      Returns string | number

    • set key(v: string | number): void

      Parameters

      • v: string | number

      Returns void

    • get props(): any

      Props passed into the component instance. Use it as read-only input when rendering.

      Returns any

    • set props(v: any): void

      Parameters

      • v: any

      Returns void

    • get ref(): any

      A reference associated with the component to be used with useRef. Can be used to expose the component instance or an underlying DOM node.

      Returns any

    • set ref(v: any): void

      Parameters

      • v: any

      Returns void

    • get state(): object

      Component state used to drive rendering. Update it with setState() to trigger a re-render.

      Returns object

    • set state(v: object): void

      Parameters

      • v: object

      Returns void

    • get type(): any

      Component context value. Use it to access shared data provided by an outer component/system.

      Returns any

    • set type(v: any): void

      Parameters

      • v: any

      Returns void

    Methods

    • The displayed name for the component. It is overridable. It can also be set for function components.

      Returns any

    • Force the component to re-render even if no state/props change. Useful for imperative updates.

      Parameters

      • callback: any

      Returns void

    • Update component state. Accepts a partial state (or a function returning partial state) and schedules a re-render.

      Parameters

      • next_state: any
      • callback: any

        to called after updates.

      Returns void