Skip to content

Receiving named combined props

Latest
Compare
Choose a tag to compare
@gnapse gnapse released this 06 Feb 13:39
· 2 commits to master since this release

This release adds support for receiving the combined props in the render prop as a single object argument, instead of as a positional list of arguments.

You can achieve this by passing the components to compose in an object with the keys that correspond to them in the resulting combined props:

const App = () => (
  <Composed components={{ mouse: Mouse, timer: Timer, counter: Counter }}>
    {({ mouse, timer, counter }) => ( ... )}
  </Composed>
)