我想根据它从下面的 api 接收到的有效负载呈现一个组件
<Route path="/foo/bar" render={() => {
return (get('/some/api').then((res) => {
return <Baz data={res.data} />
}).catch((err) => console.log))
}} />
但我收到错误:
Objects are not valid as a React child (found: [object Promise]). If you
meant to render a collection of children, use an array instead.
即使我确实换Baz
了[]