首页 > 解决方案 > Expo反应本机日志不会出现在控制台上

问题描述

尝试记录获取 json 响应时遇到问题。日志似乎没有记录,昨晚一切都很好。今天早上突然发现数据猫被记录了

 const fetchResults = async (text, offset = data.length, options = {}) => {
const { timeout = 8000 } = options;
const controller = new AbortController();
const requestUrl = `https://itunes.apple.com/search?limit=30&offset=${offset}&term=${text}`;
console.log(requestUrl);

const res = fetch(requestUrl)
  .then((res) => {
    console.log(res)
    return res.json()
  })
  .then((res) => {
    // The log below doesnt appear on console
    console.log(res);
  })
  .catch((err) => {
    console.error('Request failed', err);
  });

};

有人可以帮我 https://snack.expo.dev/@aguav/react-songlist-test

标签: react-nativeexpo

解决方案


我找到了,限制太高(30)当我更改为 10 时它又开始显示,可能日志无法打印大数据


推荐阅读