isValidElementOfType function

bool isValidElementOfType(
  1. dynamic instance,
  2. dynamic typeAlias
)

Returns whether instance is a valid ReactElement of the type associated with typeAlias, which can be a component's:

Related: isComponentOfType

Implementation

bool isValidElementOfType(dynamic instance, dynamic typeAlias) {
  return isValidElement(instance) && isComponentOfType(instance as ReactElement, typeAlias);
}