Skip to Content
react-utilsisNonFragmentReactElement

isNonFragmentReactElement

See source on Github 

Checks whether x is of type ReactElement, excluding Fragment.

  • @param x - Value to check
  • @returns true if x is a ReactElement and not a Fragment, false otherwise.

Example

const value = <div>Hello</div> isNonFragmentReactElement(value) // true