getDefaultProps method

  1. @override
  2. @mustCallSuper
  3. @Deprecated('Only supported in the deprecated Component, and not in Component2. See doc comment for more info.')
Map getDefaultProps()
override

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 getDefaultProps will be shared across instances, not copied.

See: reactjs.org/docs/react-component.html#getdefaultprops

DEPRECATED - DO NOT USE

Use the defaultProps getter instead.

Implementation

@override
@mustCallSuper
@Deprecated('Only supported in the deprecated Component, and not in Component2. See doc comment for more info.')
Map getDefaultProps() => throw _unsupportedLifecycleError('getDefaultProps');