Skip to content

Instantly share code, notes, and snippets.

@thulioph
Last active September 13, 2018 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thulioph/17a1ea9ca9d060a913cf64696c4477c9 to your computer and use it in GitHub Desktop.
Save thulioph/17a1ea9ca9d060a913cf64696c4477c9 to your computer and use it in GitHub Desktop.
An example to demonstrate the nest API of Recompose
import React from 'react';
import { nest } from 'recompose';
const Header = ({ children }) => (
<div>
<header>HEY!</header>
{children}
</div>
);
const Container = ({ children }) => (
<section>
<h1>Title of the Section!</h1>
{children}
</section>
);
const Content = ({ children }) => <p>{children}</p>;
const MyPost = nest(Header, Container, Content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment