isValidElementOfType function
Returns whether instance
is a valid ReactElement of the type associated with
typeAlias
, which can be a component's:
- UiFactory (Dart components only)
- UiComponent Type (Dart components only)
- ReactComponentFactoryProxy
ReactClass
component factory- String tag name (DOM components only)
Related: isComponentOfType
Implementation
bool isValidElementOfType(dynamic instance, dynamic typeAlias) {
return isValidElement(instance) && isComponentOfType(instance as ReactElement, typeAlias);
}