/with-wrapper

React HOC for wrapper components.

Primary LanguageJavaScriptMIT LicenseMIT

with-wrapper

GitHub npm version npm downloads React

React HOC for wrapper components.

Usage

import {withWrapper} from 'with-wrapper'

export const App = withWrapper((element, props) => (
  <div className="wrapper">
    {element}
  </div>
))((props) => {
  return (
    <p>
      This is App.
    </p>
  )
})

The above component will be rendered as:

<div class="wrapper">
  <p>
    This is App.
  </p>
</div>