React Props in React Detecting the type of Children components


Sometimes it's really useful to know the type of child component when iterating through them. In order to iterate through the children components you can use React util function:, (child) => {
  if (child.type === MyComponentType) {

The child object exposes the type property which you can compare to a specific component.