【发布时间】:2017-11-09 05:25:53
【问题描述】:
将对象传递给 QueryRenderer 变量。在成功渲染的 refetch 容器中,当对象发生任何变化时,容器就会中断。还将整数作为变量传递,该变量不会通过重新获取而因更改而中断。
即-
<QueryRenderer
query={query}
variables={
count: 5,
testObject= {
something1: {
something2: ['something', 'something']
}
}
...
/>
Refetch container calls via
_onRefetch() => {
const newSearch = {
something1: {
something2: ['somethingElse'],
}
};
const refetchVariables = fragmentVariables => ({
testObject: newSearch,
count: this.state.currentCount + 10,
});
nullthrows(this.props.relay).refetch(
refetchVariables,
null);
}
relay modern refetch 不处理对象,还是我做错了什么?
【问题讨论】:
-
the container breaks是什么意思?显示的错误信息是什么?