И
Size: a a a
И
sb
🦜
И
🦜
🦜
{
process.env.NODE_ENV !== 'production' && <DevComponent />
}
И
{
process.env.NODE_ENV !== 'production' && <DevComponent />
}
RI
🦜
RI
🦜
🦜
И
VK
RI
БВ
LS
LS
V
import { createFactory } from "react";
const withSection = (hocsMap, name = "itemsType") => WrappedComponent => {
const Wrapper = props => {
const type = props[name];
const hoc = hocsMap[type] || ((Component) => Component);
const factory = createFactory(hoc(WrappedComponent));
return factory(props);
};
return Wrapper;
};
export default withSection;