TypeError:(0,this.props.children)不是一个函数react + apollo

时间:2018-11-15 11:29:51

标签: reactjs apollo apollo-client

我有这样的select Directorate ,count(*) as [Total ticket] from ( select Directorate1 as Directorate from tablename where Directorate1 is not null union all select Directorate2 from tablename where Directorate2 is not null union all select Directorate3 from tablename where Directorate3 is not null union all select Directorate4 from tablename where Directorate4 is not null union all select Directorate5 from tablename where Directorate5 is not null )A group by Directorate

MyExampleComponent

我有一个这样的组件。查询包装一个Mutation。我想将数据从查询传递到突变

它在控制台<Query query={GET_UPGRADE_OFFER}> {({loading, error, data}) => { if (!loading && !error) { return (<Mutation mutation={GET_UPGRADE_QUOTE}> {(mutateIntegration, response) => ( <MyComponent mutateIntegration={mutateIntegration} {...response} data={data} /> )} </Mutation>); } return null; }}; </Query> 中引发错误

正在从另一个组件调用该组件

TypeError: (0 , this.props.children) is not a function

1 个答案:

答案 0 :(得分:1)

这是我的一个错误

错误出在}};。组件内部的;被视为无效子级。有效的是组件,表达式,null,false,true和undefined。

https://reactjs.org/docs/jsx-in-depth.html