src/Forms/GridField/GridFieldConfig.php
public function getComponentByType($type)
    {
        foreach ($this->components as $component) {
            if ($component instanceof $type) {
                return $component;
            }
        }
        return null;
    }
public function getComponentByType($type)
    {
        foreach ($this->components as $component) {
            if ($component instanceof $type) {
                return $component;
            }
        }
        return null;
    }
public function getComponentByType ( $ type ) { foreach ( $ this -> components as $ component ) { if ( $ component instanceof $ type ) { return $ component ; } } return null ; }
Returns the first available component with the given class or interface.

@param string $type ClassName
@return GridFieldComponent
Returns the first available component with the given class or interface .