react-hold
Version:
Hold the empty presentational components in react.js
15 lines (14 loc) • 374 B
JavaScript
import HoC from './HoC';
/**
* A decorator make component has a placeholder.
*
* @param {Function} condition
* @param {Component} holder
* @param {Object} holderProps
* @returns {Function}
*/
export default function (condition, holder, holderProps) {
return function wrap(WrappedComponent) {
return HoC(WrappedComponent, condition, holder, holderProps);
};
}