Skip to content

v0.6.0

Latest
Compare
Choose a tag to compare
@pedronauck pedronauck released this 12 May 20:54
· 4 commits to master since this release

Changelog

  • Add support to pass a component as mapper value
  • Hoisting non-react statics methods from mapper value to Composed component (thanks @russelh15)
import { React } from 'react'
import { adopt } from 'react-adopt'
import { Value } from 'react-powerplug'

const Greeter = ({ render, name }) => render(`Hi ${name.value}`)

Greeter.sayHi = (name) => `Hi ${name}`

const Composed = adopt({
  name: <Value name="John" />
  greet: Greet
})

console.log(Composed.sayHi('John')) // Hi John

const App = () => (
  <Composed>
    {({ greet, name }) => /* ... */ }
  </Composed>
)