decorate-component-with-props

v1.2.1
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
npm i decorate-component-with-props

Metadata

  • MIT
  • Whatever
  • Julian Krispel-Samsel
  • released 6/9/2022

Downloads