How do i get field type (e.g textfield, option, etc.) from
$form_state in below method.
public function validateForm(array &$form, FormStateInterface $form_state)
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
The render element types are defined using the #type property in the render array.
The only render element that the form state object (might ) reference directly is the main form element, via the getCompleteForm method.
 the form builder object sets the complete form parameter on the form state while building the form, so I'm the early stages it might not yet be set.
The form state object does hold a reference the form object. Which means that in entity forms, you can get the entity and it's fields from the form state object.