android - how to display data on View after fetching from Json in react native -
i have json output fetch method, in format
{ "example": { "id": "301", "example_n": "example", "exampleid": "12", "thumbnail": "some url", "examplearry": [ { "example_id": "9", "exampletitle": "exampletitle ", }, { "example_id": "10", "exampletitle": "exampletitle", }, { "example_id": "7", "exampletitle": "exampletitle", }, "example_api": "6vvdncv99hbnbscm" }
now want access example_id , exampletitle. how use in react native?
you can see how here.
implement fetchdata method have:
fetchdata() { fetch(request_url) .then((response) => response.json()) .then((responsedata) => { this.setstate({ examplearry: responsedata.examplearry, }); }) .done(); }
this process json response , then, this.setstate, can make data available. after this, access examplearry in javascript/react. tutorial shows how in detail in next step.
Comments
Post a Comment