const fetchData = async (key, compId, tmId) => {
console.log('params: ', { key, compId, tmId });
let url = `/this-path/comp/${compId}/tm/${tmId}`;
const result = await axios.get(url);
return result.data;
};
const fetchOutput = useQuery(['string-key', 231, 1053039], fetchData);
在上面的示例中,我们需要fetchData()参数 compId 等于231,并且 tmId 等于1053039。根据我对 react-query 的理解,我认为我会得到这个。然而,我们得到了这个:
...在 key.queryKey 可以访问 queryKey 数组,但是参数compId和tmId未定义,即使我们这样使用 useQuery():useQuery(['string-key', 231, 1053039], fetchData)...
我们在这里缺少什么吗?我们怎样才能让这些值作为回调fetchData函数的参数呢?

