nullableRequiredProp top-level constant

Accessor const nullableRequiredProp

Marks a prop as required to be set, but allowed to be set explicitly to null.

Validation occurs in UiComponent.validateRequiredProps which requires super calls into componentWillMount and componentWillReceiveProps.

mixin FooProps on UiProps {
  @nullableRequiredProp
  String nullableRequiredProp;
}

Implementation

const Accessor nullableRequiredProp = Accessor(isRequired: true, isNullable: true);