getComponentByTestId function

Component? getComponentByTestId(
  1. dynamic root,
  2. String value, {
  3. String key = defaultTestIdKey,
})

Returns the react.Component of the first descendant of root that has its key prop value set to value.

Returns null if no descendant has its key prop value set to value.

Implementation

react.Component? getComponentByTestId(dynamic root, String value, {String key = defaultTestIdKey}) {
  var instance = getByTestId(root, value, key: key);
  if (instance != null) {
    return getDartComponent(instance);
  }

  return null;
}