--- layout: page --- # getElementName() Returns the name of the react element (tag name, functional component or class component). ```typescript getElementName(element: ReactNode): string ``` ## Arguments
element
The react element for getting its name.
## Return Value A `string` that is the name of the react element. ## Examples ```jsx import React, { Component, JSX, ReactElement } from 'react'; import { getElementName } from 'react-children-utilities'; getElementName(''); // Result: 'span' const Example = (): ReactElement =>
this is the inner content
; getElementName(); // Result: 'Example' class Example2 extends Component { public override render(): JSX.Element { return
; } } getElementName(); // Result: 'Example2' ```