【发布时间】:2020-02-24 14:27:01
【问题描述】:
loadGreeting() 不是由其他时间引起 props.currentStore 的变化
const [loadGreeting, { called, loading, data }] = useLazyQuery(
GET_COOKIES,
{ context: {
headers: {
"x-request-shop-id": props.currentStore ? props.currentStore.id : ""
},
}},
);
useEffect(() => {
if (props.currentStore.id) {
loadGreeting();// here it comes a change but does not cause other data props.correntStore
}
}, [props.currentStore ]);
【问题讨论】:
标签: reactjs graphql react-hooks