defaultProps property
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.
This method is invoked before any instances are created and thus cannot rely on props. In addition, be aware
that any complex objects returned by defaultProps
will be shared across instances, not copied.
Example:
// ES6 component
Component.defaultProps = {
count: 0
};
// Dart component
@override
get defaultProps => {'count': 0};
See: reactjs.org/docs/react-without-es6.html#declaring-default-props See: reactjs.org/docs/react-component.html#defaultprops
Implementation
@override
get defaultProps => (newProps()
..isFlexChild = false
..isFlexContainer = false
..shrink = false
..quickMount = false
);