Last active
September 13, 2018 03:54
-
-
Save thulioph/17a1ea9ca9d060a913cf64696c4477c9 to your computer and use it in GitHub Desktop.
An example to demonstrate the nest API of Recompose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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