【发布时间】:2021-06-20 16:05:02
【问题描述】:
谁能告诉我为什么我总是收到这个错误:
文本字符串必须在组件内呈现
我已取出部分 API 密钥。
这是我的代码:-
componentDidMount() {
fetch(
`https://api.nomics.com/v1/currencies/ticker?key=11300ce692510973c&ids&interval=5m,30d&convert=GBP&per-page=100&page=1`
).then((response) => response.json())
.then((data) => {
const ndata = data;
const test = data.map((element) => element);
this.setState({ new: test }); })}
render() {
const test = this.state.new.map((e)=>{return(<SvgUri width="10%" height="10%" source={{uri:e.logo_url}}/>)})
return (
<View>{test}</View>
)
}
}
【问题讨论】:
标签: javascript reactjs react-native rxjs