Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 666 Bytes

Fragment.md

File metadata and controls

29 lines (20 loc) · 666 Bytes

Fragment

A tiny polyfill for React.Fragment.

It will render a native React.Fragment if supported. Otherwise, it will wrap the children within a selector. Default is div.

Props

Props Type Description
selector string A selector to render. Default div.

Returns

React.Component: A "Fragment" wrapped React component

Examples

import Fragment from '@helpscout/react-utils/dist/Fragment'

const Pedro = () => (
  <Fragment>
    <Napoleon />
    <Debra />
  </Fragment>
)