0
I’m new to Reactjs, when I try to consume a local API I can’t, I believe that’s the message:
localhost You need to enable Javascript to run this app.
My code:
export default class App extends React.Component {
state = {
api: []
}
componentDidMount() {
axios.get('http://localhost:3010/teste')
.then(res => {
const api = res.data;
this.setState({ api });
})
}
render() {
return (
<ul>
{ this.state.api.map(apiaux =>
<div>
<li>{apiaux.id}</li>
</div>
)}
</ul>
)
}