on master help sign in
bridge/src/lib/nest.js
7 lines 247 B history raw
1import { createFactory } from 'react';
3// inspired by recompose/nest
4export const nest = (components = []) => ({ children, ...props }) =>
5 components
6 .map(createFactory)
7 .reduceRight((child, factory) => factory(props, child), children);