javascript - React Native 中的响应错误

标签 javascript reactjs react-native

Here What I have got as a response

[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

This is the Postman response

[
    [
        {
            "@id": 1,
            "name": "approval",
            "figure": "15",
            "type": "tile",
            "function": "auxxa.Approval",
            "url": "https://api.auxxa.com/BIMobile/GetApprovals"
        },
        {
            "@id": 1,
            "name": "returnCheque",
            "figure": "158,000.00",
            "type": "tile",
            "function": "auxxa.ReturnCheque",
            "url": "https://api.auxxa.com/BIMobile/GetApprovals"
        },
        {
            "@id": 1,
            "name": "notification",
            "figure": "12",
            "type": "tile",
            "function": "auxxa.Notification",
            "url": "https://api.auxxa.com/BIMobile/GetApprovals"
        }
    ]
]

Here I post my fetch method

fetch(url, {
  method: "GET"
})
  .then(response => response.json())
  .then(responseData => {
    //set your data here
    console.log("Landing Data " + responseData[0]);
  })
  .catch(error => {
    console.error(error);
  });

Could not find the actual issue.Please help me to sort out this issue.Thanks in advanced.

最佳答案

将其设为 , 而不是 +

console.log("Landing Data " , responseData[0]);

它只会打印数据,但您将全面了解您的响应

关于javascript - React Native 中的响应错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51244305/

相关文章:

javascript - 在 Firebase Microsoft 帐户身份验证中从用户获取电子邮件

css - 垂直扩展 CSS 网格行

swift - 将 MicroSoft CodePush 集成到 Swift 项目

react-native - React Native Chrome Debugger Error : NativeUIManager. getConstantsForViewManager ('Text' ) 抛出异常

android - 如何创建某种在应用程序加载后消失的启动画面/启动画面? ( native react )

Javascript - 打印对象和(不应打印)函数

javascript - jquery 移动页面加载时运行 Javascript 函数

javascript - 将 Amazon SNS 与 Meteor.js 结合使用

reactjs - 获取 react 组件的大小?

javascript - 函数调用返回 API 结果后异步更新状态