Skip to content

2.0.0

Compare
Choose a tag to compare
@developit developit released this 04 Nov 00:54
· 11 commits to master since this release
  • Add support for Pure Functional Components!
const Box = ({ title, children }) => (
  <div class="box">
    <h4>{title}</h4>
    {children}
  </div>
);

console.log(
  <div>
    <Box title="foo">
      Hello, I am <strong>foo</strong>.
    </Box>
    <Box title="bar">
      Hi! I am <strong>bar</strong>!
    </Box>
  </div>
);

This logs:

<div>
  <div class="box">
    <h4>foo</h4>
    Hello, I am <strong>foo</strong>.
  </div>
  <div class="box">
    <h4>bar</h4>
    Hi! I am <strong>bar</strong>!
  </div>
</div>