How to pass function as child?
Open
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
:wave: hi, wondering how to pass a function to a component. Trying to use the `Query` component from `react-apollo`.
```js
const hyperx = require('hyperx');
const { Query } = require('react-apollo');
const gql = require('graphql-tag');
const { createElement } = require('react');
const hx = hyperx(createElement);
hx`<${Query}
query=${gql`
{
// query here
}
`}
>
${({ loading, error, data }) => {
// function content here
}}
`
```
Returns:
```
Failed prop type: Invalid prop `children` of type `array` supplied to `Query`, expected `function`.
in Query
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.