PropValidator<T> typedef

PropValidator<T> = Error? Function(T props, PropValidatorInfo info)

Typedef for Component2.propTypes - used to check the validity of one or more of the props.

info is a PropValidatorInfo class that contains metadata about the prop referenced as the key within the Component2.propTypes map. propName, componentName, location and propFullName are available.

Implementation

typedef PropValidator<T> = Error? Function(T props, PropValidatorInfo info);