initialState property

  1. @override
Map get initialState
override

Invoked once before the Component is mounted. The return value will be used as the initial value of state.

Example:

// ES6 component
constructor() {
  this.state = {count: 0};
}

// Dart component
@override
get initialState => {'count': 0};

See: reactjs.org/docs/react-without-es6.html#setting-the-initial-state See: reactjs.org/docs/react-component.html#constructor

Implementation

@override
get initialState => (newState()
  ..$transitionPhase = _transitionPhaseDerivedFromProps(props)
);