Component class abstract

Top-level ReactJS Component class which provides the ReactJS Component API

Deprecated. The Component base class only supports unsafe lifecycle methods, which React JS will remove support for in a future major version. Migrate components to Component2, which only supports safe lifecycle methods.

Implementers
Annotations
  • @Deprecated('The Component base class only supports unsafe lifecycle methods, which React JS will remove support for in a future major version.' ' Migrate components to Component2, which only supports safe lifecycle methods.')

Constructors

Component()

Properties

childContextKeys Iterable<String>
The keys this component uses in its child context map (returned by getChildContext).
no setter
context ↔ dynamic
The React context map of this component, passed down from its ancestors' getChildContext value.
getter/setter pair
contextKeys Iterable<String>
The keys of context used by this component.
no setter
displayName String?
Allows the ReactJS displayName property to be set for debugging purposes.
no setter
hashCode int
The hash code for this object.
no setterinherited
jsThis → dynamic
The JavaScript ReactComponent instance of this Component returned by render.
no setter
nextContext Map?
Private reference to the value of context for the upcoming render cycle.
getter/setter pair
nextProps Map?
Reference to the value of props for the upcoming render cycle.
getter/setter pair
nextState Map
Public getter for _nextState.
no setter
prevContext Map?
Reference to the value of context from the previous render cycle, used internally for proxying the ReactJS lifecycle method.
getter/setter pair
prevState Map?
Reference to the value of state from the previous render cycle, used internally for proxying the ReactJS lifecycle method and componentDidUpdate.
getter/setter pair
props Map
ReactJS Component props.
getter/setter pair
ref ↔ RefMethod
DEPRECATED.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
setStateCallbacks List
The List of callbacks to be called after the component has been updated from a call to setState.
no setter
state Map
ReactJS Component state.
getter/setter pair
transactionalSetStateCallbacks List
The List of transactional setState callbacks to be called before the component updates.
no setter

Methods

componentDidMount() → void
ReactJS lifecycle method that is invoked once, only on the client (not on the server), immediately after the initial rendering occurs.
componentDidUpdate(Map prevProps, Map prevState) → void
ReactJS lifecycle method that is invoked immediately after the Component's updates are flushed to the DOM.
componentWillMount() → void
ReactJS lifecycle method that is invoked once, both on the client and server, immediately before the initial rendering occurs.
componentWillReceiveProps(Map newProps) → void
ReactJS lifecycle method that is invoked when a Component is receiving newProps.
componentWillReceivePropsWithContext(Map newProps, dynamic nextContext) → void

UNSUPPORTED IN COMPONENT2

This API was never stable in any version of ReactJS, and was replaced with a new, incompatible context API in ReactJS 16.

This will be completely removed alongside the Component class.

componentWillUnmount() → void
ReactJS lifecycle method that is invoked immediately before a Component is unmounted from the DOM.
componentWillUpdate(Map nextProps, Map nextState) → void
ReactJS lifecycle method that is invoked immediately before rendering when nextProps or nextState are being received.
componentWillUpdateWithContext(Map nextProps, Map nextState, Map? nextContext) → void

DEPRECATED - DO NOT USE

This API was never stable in any version of ReactJS, and was replaced with a new, incompatible context API in ReactJS 16.

This will be completely removed alongside the Component class.

getChildContext() Map<String, dynamic>
Returns a Map of context to be passed to descendant components.
getDefaultProps() Map
Invoked once and cached when registerComponent is called. Values in the mapping will be set on props if that prop is not specified by the parent component.
getInitialState() Map
Invoked once before the Component is mounted. The return value will be used as the initial value of state.
initComponentInternal(Map props, void _jsRedraw(), [RefMethod? ref, dynamic _jsThis, Map? context]) → dynamic
initStateInternal() → dynamic
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
redraw([dynamic callback()?]) → void
Force a call to render by calling setState, which effectively "redraws" the Component.
render() → dynamic
Required.
replaceState(Map? newState, [dynamic callback()?]) → void
Set _nextState to provided newState value and force a re-render.
setState(covariant dynamic newState, [dynamic callback()?]) → void
Triggers a rerender with new state obtained by shallow-merging newState into the current state.
shouldComponentUpdate(Map nextProps, Map nextState) bool
ReactJS lifecycle method that is invoked before rendering when nextProps or nextState are being received.
shouldComponentUpdateWithContext(Map nextProps, Map nextState, Map? nextContext) bool?

DEPRECATED - DO NOT USE

This API was never stable in any version of ReactJS, and was replaced with a new, incompatible context API in ReactJS 16.

This will be completely removed alongside the Component class.

toString() String
A string representation of this object.
inherited
transferComponentState() → void
Transfers Component _nextState to state, and state to prevState.

Operators

operator ==(Object other) bool
The equality operator.
inherited