Answer the question
In order to leave comments, you need to log in
Why swears at map?
const appsService = new AppsService();
constructor(props) {
super(props);
this.state = {
apps: [],
};
}
componentDidMount() {
var self = this;
const {
match: { params },
} = this.props;
appsService.getApp(params.pk).then(function (result) {
console.log(result);
self.setState({ apps: result });
});
getApp(pk) {
const url = `${API_URL}/api/apps/${pk}/`;
return axios.get(url).then((response) => response.data);
{this.state.apps.map((app) => (
<h1>{app.title}</h1>
))}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question