我不知道为什么当我试图点击我的yelp api时,我得到了400个糟糕的请求错误。
Request failed with status code 400
- node_modules\axios\lib\core\createError.js:15:17 in createError
- node_modules\axios\lib\core\settle.js:16:9 in settle
- node_modules\axios\lib\adapters\xhr.js:52:6 in handleLoad
- node_modules\event-target-shim\dist\eve
我正在尝试弄清楚如何使用中的数据。在json.stringify之后,你如何读取yelp给出的数据。这就是我所做的
var output = JSON.stringify(data);
alert(output[0].id) // This comes out to be undefined.
如何从yelp api读取json数据?
我刚开始使用react/redux --我对服务器端在new /redux中的渲染有点困惑,是的,我在互联网上看到了一些例子,但是当我尝试使用带有外部服务器的模拟api时,服务器端呈现不起作用。
cat.js
import React from 'react';
import {render} from 'react-dom';
import {connect} from 'react-redux';
import * as mockApi from '../Actions/mockActions';
class Cat exte
从React.js开始,我的API后端有一个端点,它返回一个JSON响应。如何访问React组件中的JSON,并通过它循环创建其他元素的副本:
例子:.
class Books extends React.Component {
constructor() {
super();
// have access to JSON here from API
}
render() {
const books = jsonResponse.map((val) => {
<img src={jsonResponse.imgSrc} />
我在从后端获取数据时遇到了问题。当我试图从后端呈现数据时,会出现错误。
Portfolio.js:34 Uncaught TypeError: Cannot read properties of undefined (reading 'self')
at Portfolio.render (Portfolio.js:34:1)
at finishClassComponent (react-dom.development.js:17485:1)
at updateClassComponent (react-dom.development.js:17435:1)
at beginW