Skip to content

Initial release

Compare
Choose a tag to compare
@pedronauck pedronauck released this 30 Mar 03:30
· 73 commits to master since this release

Usage

import React from 'react'
import { render } from 'react-dom'
import { adopt } from 'react-adopt'

import { Filter } from './my-awesome-filter-component'

const Composed = adopt({
  kids: <Filter list={people} by={p => p.age < 18} />,
  adults: <Filter list={people} by={p => p.age >= 18} />
})

const App = () => (
  <Composed>
    {({ kids, adults }) => (
      <div>
        <ul>{kids.map(p => <li>{p.name}</li>)}</ul>
        <ul>{adults.map(p => <li>{p.name}</li>)}</ul>
      </div>
    )}
  </Composed>
)