react-div-wrapper-hoc

1.0.0 • Public • Published

react-div-wrapper-hoc

skinny-thin component wrapper hoc for atomic design

usage

react-div-wrapper-hoc generates wrapped component with props named divClassName . when this props was passed, origin DOM will be wrapped with extra

tag with give className. this might help you in case you reuse component with additional styling behaviour.
import * as React from 'react';
import divWrapperHoC from 'react-div-wrapper-hoc';

const Component = (props: Props): JSX.Element => {
  <span />
}

const WrappedComponent = divWrapperHoC(Component);

() => <WrappedComponent divClassName='addedClass'>
/*
 * this renders
 * <div class='addedClass'>
 *   <span></span>
 * </div>
 */

Readme

Keywords

Package Sidebar

Install

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

9.28 kB

Total Files

5

Last publish

Collaborators

  • tomnack