decorate-component-with-props

v1.0.2
Utility function for decorating a React component with any props

A simple function to decorate your component with miscellaneous props:

Example:

import decorateComponentWithProps from 'decorate-component-with-props';

const props = {
  wine: 'red',
  beer: 'ipa',
  food: 'spaghetti',
};

MyDecoratedComponent = decorateComponentWithProps(MyComponent, props);

// MyDecoratedComponent will now be decorated with these props

Metadata

  • MIT
  • Whatever
  • Julian Krispel-Samsel
  • released 3/22/2016

Downloads

Maintainers