I did fetch data from NYTimes API and console log them.
My initial state is {searchResponse: null}
Then set state the response
this.setState=({searchResponse:response.data});
and pass it to another component named listview_component. In that component, I handle the null value of prop.
but the response from the API did not push in searchResponse. and show the error : TypeError: Cannot set property 'setState' of undefined.
How to solve this?
please check out this code
https://github.com/shojibMahabub/news-scroller/tree/develop
No comments:
Post a Comment