Good morning, could anyone help me with react-native ??? The codes below and my doubts are below
componentDidMount() {
return fetch('http://portal.ema.net.br/api/getprocedimentospublicos', {
method: 'POST',
})
.then(response => response.json())
.then(dados => {
this.setState(
{
isLoading: false,
dados,
},
function() {}
);
})
.catch(error => {
console.error(error);
});
}
this fetch () takes a JSON like this:
{
"1": {
"TIPOPROCEDIMENTO": "Humanas",
"DESCRICAO": "Trabalhe%20com%20a%20Ema",
},
"2": {
"TIPOPROCEDIMENTO": "Uniema",
"DESCRICAO": "Solicita%E7%E3o%20de%20usu%E1rio%20AVE",
}
I mean in my STATE:
dados:{
"1": {
"TIPOPROCEDIMENTO": "Humanas",
"DESCRICAO": "Trabalhe%20com%20a%20Ema",
},
"2": {
"TIPOPROCEDIMENTO": "Uniema",
"DESCRICAO": "Solicita%E7%E3o%20de%20usu%E1rio%20AVE",
}
But I can not get this data with a simple "this.state.dados.1.TIPOPROCEDIMENTO"
So basically this is my question, how do I retrieve this data?